/* MLP — one design system for the member app and the public site.
   Warm, built, trade-appropriate. Nothing here is decorative for its own sake. */

/* Palette taken from the official My Local Pros shield:
   #509640 (upper shield) and #7CC242 (lower shield), sampled from the logo file.
   --brand-* are the real names. The --ember-* aliases below are the original
   token names, kept so existing .ember class rules keep working; they now carry
   MLP green, not orange. */
:root {
    --ink: #14170f;
    --charcoal: #1e2418;
    --slate: #3f473a;
    --muted: #6f7a68;
    --line: #dde2d8;
    --paper: #f8faf6;
    --card: #ffffff;

    --brand: #509640;
    --brand-dark: #3a7030;
    --brand-light: #7cc242;
    --brand-soft: #eef7e8;

    --ember: var(--brand);
    --ember-dark: var(--brand-dark);
    --ember-soft: var(--brand-soft);
    --anvil: #37424c;
    --gold: #b8862b;
    /* Good is a deeper green than the brand so "in good standing" never reads
       as just "branded". Warn and bad stay amber/red — they must not be green. */
    --good: #2f7d51;
    --good-soft: #eaf5ee;
    --warn: #b0761c;
    --warn-soft: #fdf3e2;
    --bad: #ad3a26;
    --bad-soft: #fbecea;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(23, 19, 15, .06), 0 8px 24px -12px rgba(23, 19, 15, .18);
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
a { color: var(--ember-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82rem; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 1.25rem; }

/* ------------------------------------------------------------- navigation */

.topbar {
    background: var(--ink);
    color: #f4efe9;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 3px solid var(--ember);
}
.topbar .wrap { display: flex; align-items: center; gap: 1.5rem; height: 58px; }
.brand {
    font-weight: 800;
    letter-spacing: -.03em;
    font-size: 1.15rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.brand:hover { text-decoration: none; }
.brand .spark { color: var(--ember); }
.brand small { display: block; font-weight: 600; font-size: .69rem; letter-spacing: .1em;
    text-transform: uppercase; color: #b3bfa9; margin-top: -3px; }
.navlinks { display: flex; gap: .25rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.navlinks a {
    color: #cdc4ba;
    padding: .4rem .7rem;
    border-radius: 7px;
    font-size: .9rem;
    font-weight: 500;
}
.navlinks a:hover { background: rgba(255, 255, 255, .09); color: #fff; text-decoration: none; }
.navlinks a.on { background: var(--ember); color: #fff; }

.subnav {
    background: var(--charcoal);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.subnav .wrap { display: flex; gap: .2rem; overflow-x: auto; padding-top: .35rem; padding-bottom: .35rem; }
.subnav a { color: #b3a79b; font-size: .85rem; padding: .3rem .65rem; border-radius: 6px; white-space: nowrap; }
.subnav a.on { background: rgba(209, 84, 31, .22); color: #fbc9ab; }
.subnav a:hover { text-decoration: none; color: #fff; }

/* ------------------------------------------------------------------ cards */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .85rem; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { margin-left: auto; }

/* Grid and flex children default to min-width:auto, which lets a wide table
   push the whole page sideways instead of scrolling inside its own container.
   This is the single most common cause of horizontal scroll on a phone. */
.grid > *, .split > *, .stack > * { min-width: 0; }
.table-wrap { max-width: 100%; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.section { padding: 1.75rem 0; }
.stack > * + * { margin-top: .75rem; }

/* ------------------------------------------------------------------ stats */

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .n { font-size: 1.75rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.stat .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 650; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat.accent { background: var(--ember-soft); border-color: #f3d3bf; }
.stat.accent .n { color: var(--ember-dark); }

.gauge { display: flex; align-items: center; gap: 1rem; }
.gauge .ring {
    --value: 0;
    width: 92px; height: 92px; border-radius: 50%; flex: none;
    background: conic-gradient(var(--ember) calc(var(--value) * 1%), #ece5dc 0);
    display: grid; place-items: center;
    position: relative;
}
.gauge .ring::after {
    content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--card);
}
.gauge .ring b { position: relative; z-index: 1; font-size: 1.5rem; letter-spacing: -.04em; }

.bar { height: 7px; background: #ece5dc; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ember); border-radius: 99px; }
.bar.good > span { background: var(--good); }
.bar.team > span { background: var(--anvil); }

/* ----------------------------------------------------------------- pills */

.pill {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .74rem; font-weight: 650; padding: .18rem .55rem; border-radius: 99px;
    background: #f0eae2; color: var(--slate); white-space: nowrap;
    border: 1px solid transparent;
}
.pill.good { background: var(--good-soft); color: var(--good); border-color: #c6e3d1; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0dcb4; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: #f0cdc6; }
.pill.ember { background: var(--ember-soft); color: var(--ember-dark); border-color: #f3d3bf; }
.pill.ink { background: var(--ink); color: #fff; }
.pill.lg { font-size: .85rem; padding: .3rem .75rem; }

.tag { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 650; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font: inherit; font-weight: 620; font-size: .9rem;
    padding: .5rem .95rem; border-radius: 8px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--ember); border-color: var(--ember); color: #fff; }
.btn.primary:hover { background: var(--ember-dark); border-color: var(--ember-dark); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.bad { background: var(--card); border-color: #e2b6ad; color: var(--bad); }
.btn.sm { font-size: .8rem; padding: .3rem .6rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ----------------------------------------------------------------- forms */

label { display: block; font-size: .82rem; font-weight: 650; margin-bottom: .25rem; color: var(--slate); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel],
input[type=number], input[type=url], input[type=time], select, textarea {
    width: 100%; font: inherit; font-size: .92rem;
    padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(209, 84, 31, .28); outline-offset: 1px; border-color: var(--ember);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field { margin-bottom: .85rem; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.inline-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; flex: 1 1 180px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
legend { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 .4rem; }

/* ----------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted); font-weight: 700; padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
td { padding: .6rem; border-bottom: 1px solid #f0ebe4; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------ lists */

.rows > * { padding: .7rem 0; border-bottom: 1px solid #f0ebe4; }
.rows > *:last-child { border-bottom: 0; }
.row-flex { display: flex; gap: .75rem; align-items: center; }
.row-flex .grow { flex: 1; min-width: 0; }

.avatar {
    width: 38px; height: 38px; border-radius: 9px; flex: none;
    display: grid; place-items: center; font-size: 1.1rem;
    background: var(--ember-soft); border: 1px solid #f0d7c6;
}
.avatar.lg { width: 64px; height: 64px; font-size: 1.9rem; border-radius: 12px; }
.avatar.xl { width: 92px; height: 92px; font-size: 2.8rem; border-radius: 16px; }

.empty { color: var(--muted); font-size: .9rem; padding: 1rem 0; text-align: center; }

/* ------------------------------------------------------------- commitment */

.commitment { border-left: 3px solid var(--ember); padding-left: .8rem; }
.commitment.kept { border-left-color: var(--good); }
.commitment.missed { border-left-color: var(--bad); }
.commitment.overdue { border-left-color: var(--warn); background: var(--warn-soft); }
.commitment .action { font-weight: 600; }

/* -------------------------------------------------------------- flash msgs */

.flashes { margin: 1rem 0 0; }
.flash {
    padding: .65rem .9rem; border-radius: 8px; font-size: .9rem; font-weight: 550;
    border: 1px solid; margin-bottom: .5rem;
}
.flash.ok { background: var(--good-soft); border-color: #c6e3d1; color: var(--good); }
.flash.win { background: var(--ember-soft); border-color: #f3d3bf; color: var(--ember-dark); }
.flash.warn { background: var(--warn-soft); border-color: #f0dcb4; color: var(--warn); }
.flash.error { background: var(--bad-soft); border-color: #f0cdc6; color: var(--bad); }

/* ------------------------------------------------------------- public site */

.hero {
    background: linear-gradient(160deg, var(--ink) 0%, #2e2419 60%, #3a2a1a 100%);
    color: #f6f1eb; padding: 4rem 0 3.5rem; position: relative; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; right: -120px; top: -80px; width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(209, 84, 31, .35), transparent 65%);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); max-width: 16ch; }
.hero p { font-size: 1.1rem; color: #d3c8bc; max-width: 54ch; }
.hero .wrap { position: relative; z-index: 1; }

.eyebrow {
    text-transform: uppercase; letter-spacing: .16em; font-size: .74rem; font-weight: 700;
    color: var(--ember); margin-bottom: .6rem;
}

.tier { display: flex; gap: 1rem; align-items: flex-start; }
.tier .n {
    font-size: 1.6rem; font-weight: 800; color: var(--ember); line-height: 1;
    font-variant-numeric: tabular-nums; flex: none; width: 2rem;
}

.procard {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1rem; display: flex; flex-direction: column; gap: .55rem; box-shadow: var(--shadow);
}
.procard:hover { border-color: var(--ember); }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; }

.credbar {
    background: var(--ink); color: #ede6de; border-radius: var(--radius);
    padding: 1rem 1.15rem; display: flex; gap: 1.5rem; flex-wrap: wrap;
}
.credbar .n { font-size: 1.3rem; font-weight: 750; color: #fff; line-height: 1.15; }
.credbar .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #a2968a; font-weight: 650; }

.steps { counter-reset: step; }
.steps li {
    counter-increment: step; list-style: none; position: relative; padding-left: 2.6rem;
    margin-bottom: 1.1rem;
}
.steps li::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    width: 1.85rem; height: 1.85rem; border-radius: 50%;
    background: var(--ember-soft); color: var(--ember-dark);
    display: grid; place-items: center; font-weight: 750; font-size: .85rem;
    border: 1px solid #f0d7c6;
}
.steps li.done::before { content: "✓"; background: var(--good); color: #fff; border-color: var(--good); }
.steps li.now::before { background: var(--ember); color: #fff; border-color: var(--ember); }

footer.site {
    background: var(--ink); color: #9b9086; padding: 2.5rem 0; margin-top: 3rem; font-size: .88rem;
}
footer.site a { color: #cdc4ba; }
footer.site h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }

/* ------------------------------------------------------------ display mode */

body.display { background: var(--ink); color: #f4efe9; }
body.display .wrap { max-width: 1400px; }
body.display h1 { font-size: 3rem; }
body.display .card { background: #201a15; border-color: #3a3128; color: #f4efe9; box-shadow: none; }
body.display .stat { background: #201a15; border-color: #3a3128; }
body.display .tag, body.display .stat .k { color: #9b9086; }
body.display table td { border-color: #33291f; }
body.display th { color: #9b9086; border-color: #3a3128; }

.mono { font-family: var(--mono); font-size: .85em; }
.muted { color: var(--muted); }
.strike { text-decoration: line-through; opacity: .55; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.mt1 { margin-top: 1rem; } .mb1 { margin-bottom: 1rem; }
.mt2 { margin-top: 2rem; }
.hr { height: 1px; background: var(--line); margin: 1.25rem 0; border: 0; }

@media (max-width: 640px) {
    .topbar .wrap { height: auto; padding-top: .5rem; padding-bottom: .5rem; flex-wrap: wrap; }
    .navlinks { margin-left: 0; width: 100%; }
    h1 { font-size: 1.6rem; }
    .hero { padding: 2.5rem 0; }
}

/* ==========================================================================
   THE PHONE APP
   Members open this on a phone, one-handed, usually standing in a van.
   Everything below is thumb-first: bottom navigation, big targets, cards
   instead of tables, and 16px inputs so iOS doesn't zoom on focus.
   ========================================================================== */

body.app {
    background: var(--paper);
    /* room for the fixed tab bar, plus the iPhone home indicator */
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.appbar {
    position: sticky; top: 0; z-index: 30;
    background: var(--ink); color: #f4efe9;
    border-bottom: 3px solid var(--ember);
    padding-top: env(safe-area-inset-top, 0px);
}
.appbar-inner {
    display: flex; align-items: center; gap: .75rem;
    max-width: 1120px; margin: 0 auto; padding: .6rem 1rem;
    min-height: 52px;
}
.applogo { display: flex; align-items: center; flex: none; }
.applogo img { display: block; height: 32px; width: auto; }

.appbar .who { line-height: 1.15; min-width: 0; }
.appbar .who strong { font-size: .98rem; display: block; color: #fff; }
.appbar .who small { color: #b3bfa9; font-size: .74rem; }
.appbar .grow { flex: 1; min-width: 0; }
.appbar a { color: #cdc4ba; }

.streak {
    display: inline-flex; align-items: center; gap: .25rem;
    background: rgba(209, 84, 31, .2); color: #fbc9ab;
    border: 1px solid rgba(209, 84, 31, .45);
    padding: .22rem .55rem; border-radius: 99px;
    font-size: .78rem; font-weight: 700; white-space: nowrap;
}

/* -------------------------------------------------------------- tab bar */

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 16px rgba(23, 19, 15, .07);
}
.tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: .5rem .2rem .55rem;
    min-height: 56px;                     /* comfortably tappable */
    color: var(--muted); text-decoration: none;
    font-size: .72rem; font-weight: 650; letter-spacing: .01em;
    position: relative;
}
.tabbar a .ico { font-size: 1.25rem; line-height: 1; }
.tabbar a.on { color: var(--ember-dark); }
.tabbar a.on::before {
    content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px;
    background: var(--ember); border-radius: 0 0 3px 3px;
}
.tabbar a .dot {
    position: absolute; top: .42rem; right: 50%; margin-right: -1.1rem;
    width: 8px; height: 8px; border-radius: 50%; background: var(--ember);
    border: 2px solid #fff;
}
.tabbar a:active { background: var(--ember-soft); }

/* ------------------------------------------------------------ app pages */

/* The app's content well. Older, denser screens (workshop, leader tools) sit
   directly in here; the phone-first screens nest a narrower .screen inside. */
.appmain { max-width: 1120px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.appmain > .screen { max-width: 760px; margin: 0 auto; padding: 0; }

.screen { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.screen.wide, .appmain > .screen.wide { max-width: 1120px; }
.screen > h1 { font-size: 1.5rem; margin-bottom: .15rem; }
.screen > .lede { color: var(--muted); font-size: .92rem; margin-bottom: 1rem; }

/* A card that is the whole tap target. */
.tapcard {
    display: block; background: var(--card); border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: var(--radius); padding: .85rem 1rem;
    color: inherit; text-decoration: none; box-shadow: var(--shadow);
}
.tapcard:hover, .tapcard:active { text-decoration: none; border-color: var(--muted); }
.tapcard + .tapcard { margin-top: .6rem; }
.tapcard.ember { border-left-color: var(--ember); }
.tapcard.warn  { border-left-color: var(--warn); }
.tapcard.bad   { border-left-color: var(--bad); }
.tapcard.good  { border-left-color: var(--good); }
.tapcard h3 { font-size: 1rem; margin-bottom: .15rem; }
.tapcard p { font-size: .875rem; color: var(--slate); margin: 0; }
.tapcard .go {
    font-size: .8rem; font-weight: 700; color: var(--ember-dark); margin-top: .45rem;
    display: inline-block;
}

/* Four-up number strip that stays readable at 360px. */
.pulse { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.pulse .cell {
    background: var(--card); border: 1px solid var(--line); border-radius: 9px;
    padding: .55rem .4rem; text-align: center;
}
.pulse .cell .n { font-size: 1.15rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.pulse .cell .k {
    /* Not smaller than 11px — these get read in a van, in daylight. */
    font-size: .69rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 700; margin-top: .1rem; line-height: 1.2;
}
.pulse .cell.good .n { color: var(--good); }
.pulse .cell.warn .n { color: var(--warn); }
.pulse .cell.bad  .n { color: var(--bad); }

/* Goal progress with a pace marker — the bit that says "behind", not just "40%". */
.track { position: relative; height: 10px; background: #ece5dc; border-radius: 99px; overflow: visible; }
.track > .fill { height: 100%; border-radius: 99px; background: var(--ember); }
.track > .fill.good { background: var(--good); }
.track > .fill.warn { background: var(--warn); }
.track > .pace {
    position: absolute; top: -4px; width: 2px; height: 18px;
    background: var(--anvil); border-radius: 2px; opacity: .65;
}
.track > .pace::after {
    content: "today"; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    font-size: .58rem; color: var(--muted); font-weight: 700; white-space: nowrap;
}
.trackwrap { padding-bottom: 1rem; }

/* Big friendly choice buttons for the check-in. */
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.choices label {
    display: flex; align-items: center; justify-content: center; gap: .35rem;
    border: 1.5px solid var(--line); border-radius: 10px;
    padding: .8rem .5rem; font-size: .9rem; font-weight: 620;
    cursor: pointer; text-align: center; background: var(--card); margin: 0;
    min-height: 52px;
}
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label:has(input:checked) {
    border-color: var(--ember); background: var(--ember-soft); color: var(--ember-dark);
}
.choices.five { grid-template-columns: repeat(5, 1fr); }
.choices.five label { padding: .7rem .2rem; font-size: 1.15rem; }

.stepnum {
    display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem;
    border-radius: 50%; background: var(--ink); color: #fff;
    font-size: .8rem; font-weight: 750; margin-right: .45rem; flex: none;
}

/* Rows that read like a list on a phone and a table on a desktop. */
.people { display: grid; gap: .5rem; }
.person {
    display: flex; align-items: center; gap: .7rem;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 10px; padding: .6rem .7rem; color: inherit; text-decoration: none;
}
.person:hover { text-decoration: none; border-color: var(--muted); }
.person .grow { flex: 1; min-width: 0; }
.person strong { font-size: .92rem; }
.person small { color: var(--muted); font-size: .78rem; }

.sheet {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
}
.sheet + .sheet { margin-top: .75rem; }
.sheet h2 { font-size: 1.05rem; }
.sheet h3 { font-size: .95rem; }

.sticky-save {
    position: sticky; bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    padding: .6rem 0; background: linear-gradient(transparent, var(--paper) 35%);
    z-index: 20;
}

.chip-row {
    display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem;
    -webkit-overflow-scrolling: touch; max-width: 100%;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row > * {
    flex: none;
    /* Chips are tap targets, not decoration — keep them thumb-sized. */
    min-height: 38px; padding: .5rem .8rem; font-size: .8rem; line-height: 1.25;
    white-space: normal; max-width: 15rem; text-align: left;
}

.quiet-link { color: var(--muted); font-size: .82rem; }

.pill.brand { background: var(--brand-soft); color: var(--brand-dark); border-color: #cfe6c2; }

/* ---------------------------------------------------------- chapter chat */

.chatscreen { padding-bottom: 0; }

.chathead {
    position: sticky; top: 0; z-index: 15;
    background: var(--paper); padding: .2rem 0 .6rem;
    border-bottom: 1px solid var(--line); margin-bottom: .8rem;
}
.chathead h1 { font-size: 1.25rem; }

.thread { display: flex; flex-direction: column; gap: .55rem; padding-bottom: 5.5rem; }

.msg { display: flex; gap: .5rem; align-items: flex-end; max-width: 92%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }

.bubble {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 14px 14px 14px 4px; padding: .55rem .75rem;
    box-shadow: 0 1px 2px rgba(20, 23, 15, .05); min-width: 0;
}
.msg.mine .bubble {
    background: var(--brand-soft); border-color: #cfe6c2;
    border-radius: 14px 14px 4px 14px;
}
.bubble .who { font-size: .76rem; font-weight: 700; color: var(--brand-dark); margin-bottom: .1rem; }
.bubble .body { font-size: .95rem; line-height: 1.45; overflow-wrap: anywhere; }
.bubble .meta {
    display: flex; align-items: center; gap: .5rem; margin-top: .25rem;
    font-size: .7rem; color: var(--muted);
}
.reactbtn {
    background: none; border: 1px solid var(--line); border-radius: 99px;
    font: inherit; font-size: .72rem; padding: .12rem .45rem; cursor: pointer;
    color: var(--muted); min-height: 26px;
}
.reactbtn:hover { border-color: var(--brand); color: var(--brand-dark); }

.composer {
    position: fixed; left: 0; right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    display: flex; gap: .4rem; align-items: center;
    padding: .5rem .8rem calc(.5rem + env(safe-area-inset-bottom, 0px) * 0);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line); z-index: 40;
}
.composer input[type=text] { flex: 1; min-height: 42px; border-radius: 99px; }
.composer select {
    width: auto; flex: none; min-height: 42px; border-radius: 99px;
    font-size: .82rem; padding: .3rem .5rem; max-width: 6.6rem;
}
.composer .btn { min-height: 42px; min-width: 46px; border-radius: 99px; font-size: 1.1rem; }

@media (min-width: 900px) {
    .composer { position: sticky; bottom: 0; margin: 0 -1rem; border-radius: 0; }
    .thread { padding-bottom: 1rem; }
}

/* Phone tuning */
@media (max-width: 560px) {
    .screen { padding: .85rem .8rem 1.5rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
    .pulse { grid-template-columns: repeat(2, 1fr); }
    .choices { grid-template-columns: 1fr 1fr; }
    /* 16px stops iOS zooming the whole page when a field is focused */
    input[type=text], input[type=email], input[type=password], input[type=date],
    input[type=tel], input[type=number], input[type=url], input[type=time],
    select, textarea { font-size: 16px; }
    .btn { padding: .65rem 1rem; min-height: 44px; }
    .btn.sm { min-height: 36px; }
    h1 { font-size: 1.45rem; }
    .card, .sheet { padding: .9rem; }
}

/* Desktop: swap the tab bar for a normal top nav. */
@media (min-width: 900px) {
    .tabbar { display: none; }
    body.app { padding-bottom: 0; }
    .appbar-inner { min-height: 58px; }
    .deskonly { display: flex !important; }
}
@media (max-width: 899px) {
    .deskonly { display: none !important; }
}

/* ------------------------------------------------- chapter switcher
   Belonging to more than one chapter (nine businesses do) means the app must
   always say which one you're looking at. A <details> keeps it working with
   no JavaScript. */
.chapterpick { min-width: 0; position: relative; }
.chapterpick > summary {
    list-style: none; cursor: pointer; line-height: 1.15;
    padding: .1rem .4rem .1rem 0;
}
.chapterpick > summary::-webkit-details-marker { display: none; }
.chapterpick > summary strong {
    font-size: .98rem; display: block; color: #fff;
}
.chapterpick > summary strong::after { content: " ▾"; opacity: .55; font-size: .8em; }
.chapterpick > summary small { color: #b3bfa9; font-size: .74rem; }
.chapterpick > summary .tag { color: var(--brand-light); }
.chapterlist {
    position: absolute; z-index: 60; top: 100%; left: 0; min-width: 190px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.22); padding: .35rem; margin-top: .4rem;
    display: flex; flex-direction: column; gap: .15rem;
}
.chapterlist button {
    text-align: left; background: none; border: 0; border-radius: 8px;
    padding: .6rem .7rem; font: inherit; font-size: .95rem; color: var(--ink);
    cursor: pointer; min-height: 44px;
}
.chapterlist button:hover { background: var(--brand-soft); }
.chapterlist button.on { background: var(--brand); color: #fff; font-weight: 650; }

/* --------------------------------------------------- meeting schedule */
.datechip {
    flex: 0 0 auto; width: 48px; text-align: center; border-radius: 10px;
    background: var(--brand-soft); border: 1px solid #cfe6c2; padding: .3rem 0;
    line-height: 1.05;
}
.datechip .d { display: block; font-size: 1.25rem; font-weight: 750; color: var(--brand-dark); }
.datechip .mo { display: block; font-size: .62rem; letter-spacing: .08em; color: var(--muted); }

a.card.tappable { text-decoration: none; color: inherit; display: flex; gap: .8rem; align-items: center; }
a.card.tappable:hover { border-color: var(--brand); }

.card.accent { border-left: 4px solid var(--brand); }
.card.alert { border-left: 4px solid var(--bad); }

ol.rotation { margin: 0; padding-left: 1.4rem; }
ol.rotation li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
ol.rotation li:last-child { border-bottom: 0; }
ol.rotation li.me { font-weight: 650; }
ol.rotation li.skipped { opacity: .5; }
/* On a phone a company name plus four controls will not fit on one line, so the
   controls drop underneath rather than pushing the row off the screen. */
ol.rotation.editable li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
ol.rotation.editable li > .grow { min-width: 0; flex: 1 1 100%; }
.inline-actions { display: flex; gap: .25rem; flex-shrink: 0; flex-wrap: wrap; }
@media (min-width: 620px) {
    ol.rotation.editable li > .grow { flex: 1 1 auto; }
}
.btn.xs { padding: .3rem .5rem; font-size: .78rem; min-height: 34px; }
.btn.danger { color: var(--bad); border-color: #f0cdc6; }
.row-flex.tight { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.emoji { flex: 0 0 auto; font-size: 1.15rem; }

/* ---------------------------------------------- attendance
   Everyone is here by default, so the switch starts on and you turn people off.
   Marking sixteen people present was the wrong default work. */
/* Compact: a seventeen-person register should fit on one screen, not scroll
   for a minute. Names sit at body size, trade drops to a caption. */
.attendance-sheet .att-row {
    display: flex; align-items: center; gap: .5rem;
    padding: .3rem 0; border-bottom: 1px solid var(--line);
}
.attendance-sheet .att-row strong { font-size: .92rem; font-weight: 620; line-height: 1.25; }
.attendance-sheet .att-row .excused-note { font-size: .72rem; line-height: 1.2; }
.attendance-sheet .att-row:last-child { border-bottom: 0; }
.attendance-sheet .att-row.absent { opacity: .5; }
.attendance-sheet .att-row.absent strong { text-decoration: line-through; }
.attendance-sheet .att-row.failed { outline: 2px solid var(--bad); border-radius: 8px; }

.attendance-sheet button.emoji {
    background: none; border: 0; padding: 0; font-size: 1.05rem; line-height: 1;
    cursor: pointer; border-radius: 8px; min-width: 28px; min-height: 34px;
}
.attendance-sheet button.emoji[disabled] { cursor: default; }
.att-row.excused button.emoji { background: var(--brand-soft); outline: 1px solid #cfe6c2; }
.att-row .excused-note { font-size: .74rem; }

/* The switch itself: 52x32 with a 44px tap area, so a thumb can't miss it. */
.attendance-sheet button.toggle {
    flex: 0 0 auto; margin-left: auto; width: 46px; height: 28px; border-radius: 99px; cursor: pointer;
    border: 1px solid var(--line); background: #e6e1da; padding: 0; position: relative;
    transition: background .13s ease, border-color .13s ease;
}
.attendance-sheet button.toggle::after {
    content: ""; position: absolute; inset: -6px;      /* invisible 44px target */
}
.attendance-sheet button.toggle .knob {
    position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.28);
    transition: transform .13s ease;
}
.attendance-sheet button.toggle[aria-pressed="true"] {
    background: var(--good); border-color: var(--good);
}
.attendance-sheet button.toggle[aria-pressed="true"] .knob { transform: translateX(18px); }
.attendance-sheet button.toggle[disabled] { opacity: .4; cursor: default; }

/* -------------------------------------------------- notes and write-up */
.notelist .row-flex { padding: .5rem 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notelist .row-flex:last-child { border-bottom: 0; }
.summary .prose { font-size: .95rem; }
.summary .prose h3 {
    font-size: .82rem; text-transform: uppercase; letter-spacing: .07em;
    color: var(--brand-dark); margin: 1rem 0 .35rem;
}
.summary .prose h3:first-child { margin-top: .2rem; }
.summary .prose ul { margin: 0 0 .5rem; padding-left: 1.1rem; }
.summary .prose li { margin-bottom: .3rem; }
.summary .prose p { margin: 0 0 .5rem; }
.summary .prose hr { border: 0; border-top: 1px solid var(--line); margin: .8rem 0; }
.warn-line { color: var(--warn); margin: .3rem 0; }

/* ------------------------------------------- collapsible meeting sections
   One meeting is one page. Sections fold so the page stays scannable on a
   phone instead of becoming a mile of form. */
details.section-block { padding: 0; margin-bottom: .75rem; }
details.section-block > summary {
    display: flex; align-items: center; gap: .6rem; cursor: pointer;
    padding: .9rem 1rem; list-style: none; min-height: 56px;
}
details.section-block > summary::-webkit-details-marker { display: none; }
details.section-block > summary::after {
    content: "⌄"; font-size: 1.1rem; color: var(--muted); line-height: 1;
    transition: transform .15s ease; flex: 0 0 auto;
}
details.section-block[open] > summary::after { transform: rotate(180deg); }
details.section-block[open] > summary { border-bottom: 1px solid var(--line); }
details.section-block > summary strong { font-size: 1rem; }
details.section-block > *:not(summary) { padding-left: 1rem; padding-right: 1rem; }
details.section-block > *:not(summary):last-child { padding-bottom: 1rem; }

.backlink {
    display: inline-block; margin-bottom: .5rem; color: var(--muted);
    text-decoration: none; font-size: .88rem; font-weight: 650; min-height: 32px;
}
.backlink:hover { color: var(--brand-dark); }

a.sheet.tappable { display: flex; gap: .8rem; align-items: center;
                   color: inherit; text-decoration: none; }
a.sheet.tappable:hover { border-color: var(--brand); }
.sheet.accent { border-left: 4px solid var(--brand); }
.sheet.alert { border-left: 4px solid var(--bad); }
.sheet .big { font-size: 1.25rem; display: block; }
.datechip.quiet { background: #f4f1ec; border-color: var(--line); }
.datechip.quiet .d { color: var(--muted); }
.chev { color: var(--muted); flex: 0 0 auto; }

/* --------------------------------------------- sign-in links (accounts)
   The link is long and gets copied into a text message, so it needs to be
   selectable, monospaced, and impossible to mistake for editable content. */
.invite-box {
    background: var(--brand-soft); border: 1px solid #cfe6c2;
    border-radius: 10px; padding: .6rem .7rem; margin-top: .6rem;
}
.invite-box input[readonly] {
    font-family: var(--mono); font-size: 13px; background: #fff;
    padding: .5rem .6rem; min-height: 42px;
}
.invite-box .row-flex { gap: .4rem; }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------- view-as-member
   A preview you can't tell you're inside is worse than none: you'd think the
   chapter tools had disappeared. So it announces itself on every screen. */
.modebar {
    position: sticky; top: 0; z-index: 45;
    display: flex; align-items: center; gap: .6rem;
    background: var(--warn-soft); border-bottom: 1px solid #f0dcb4;
    color: var(--warn); font-size: .82rem; font-weight: 650;
    padding: .5rem .9rem;
}
.modebar .btn { background: #fff; }

.modeswitch { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.modeswitch form { display: contents; }
.modeswitch button {
    width: 100%; text-align: left; cursor: pointer; font: inherit;
    padding: .7rem .8rem; min-height: 60px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.modeswitch button strong { display: block; font-size: .95rem; }
.modeswitch button small { color: var(--muted); font-size: .76rem; }
.modeswitch button.on {
    border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand);
}
.modeswitch button.on small { color: var(--brand-dark); }

/* ================================================================= sign-in
   The first screen 24 members ever see, on a phone, one-handed, probably in a
   van. Full-bleed brand, one card, nothing to tap but the thing you came for. */
body.authpage {
    background: var(--ink);
    /* Subtle brand wash rather than a flat slab — reads as a product, not a
       default Flask page. */
    background-image:
        radial-gradient(120% 80% at 50% 0%, rgba(80, 150, 64, .38) 0%, transparent 62%),
        linear-gradient(180deg, #1b2016 0%, var(--ink) 60%);
    background-attachment: fixed;
    min-height: 100dvh;
}
.authwrap {
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    /* Safe areas so it clears the notch and the home indicator when installed. */
    padding: max(1.25rem, env(safe-area-inset-top)) 1.1rem
             max(1.25rem, env(safe-area-inset-bottom));
}
.authcard {
    width: 100%; max-width: 420px;
    background: var(--card); border-radius: 18px;
    padding: 1.6rem 1.35rem 1.4rem;
    box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .55);
}
.authlogo { display: block; margin: 0 auto .9rem; height: auto; }
.authcard h1 { font-size: 1.6rem; text-align: center; margin-bottom: .3rem; }
.authlede {
    text-align: center; color: var(--muted); font-size: .92rem;
    margin: 0 0 1.25rem; line-height: 1.45;
}

.authform label {
    display: block; font-size: .8rem; font-weight: 650;
    color: var(--slate); margin: 0 0 .3rem;
}
.authform input {
    width: 100%; margin-bottom: 1rem;
    /* 17px: under 16 and iOS zooms the whole page on focus. */
    font-size: 17px; min-height: 52px; padding: .8rem .9rem;
    border-radius: 11px;
}
.authform input:last-of-type { margin-bottom: 1.1rem; }
.authgo {
    min-height: 54px; font-size: 1.02rem; border-radius: 11px;
    margin-bottom: 0;
}
.authhint { font-size: .8rem; color: var(--muted); margin: -.5rem 0 1rem; }
.authshow { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin: -.25rem 0 .75rem; }
.authshow input { width: auto; }
.authhelp {
    margin: 1.1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line);
    font-size: .84rem; color: var(--muted); line-height: 1.5; text-align: center;
}

/* Who the invite belongs to — reassurance that the link is really theirs. */
.authwho {
    display: flex; align-items: center; gap: .65rem;
    background: var(--brand-soft); border: 1px solid #cfe6c2;
    border-radius: 12px; padding: .65rem .8rem; margin-bottom: 1.1rem;
}
.authwho .emoji { font-size: 1.4rem; }
.authwho strong { display: block; font-size: .95rem; line-height: 1.2; }
.authwho small { color: var(--muted); font-size: .78rem; word-break: break-all; }

/* Demo tap-to-sign-in, laptop only. */
.authdemo { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.authdemo > summary {
    cursor: pointer; font-size: .85rem; font-weight: 650; color: var(--brand-dark);
}
.demorow {
    display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
    font: inherit; cursor: pointer; margin-top: .5rem;
    background: #fff; border: 1px solid var(--line); border-radius: 11px;
    padding: .6rem .7rem; min-height: 56px;
}
.demorow:hover { border-color: var(--brand); background: var(--brand-soft); }
.demorow strong { display: block; font-size: .92rem; }
.demorow small { color: var(--muted); font-size: .76rem; }
.demorow .grow { min-width: 0; }

/* Flash messages sit above the card rather than in the page flow. */
body.authpage .flashes {
    max-width: 420px; margin: 0 auto; padding: 1rem 1.1rem 0;
    position: relative; z-index: 2;
}

/* ------------------------------------------------- installed-app polish
   Once it's on the home screen there is no browser chrome to explain away a
   web-page feel, so these remove the last few tells. */
body.app, body.authpage {
    /* Stops the rubber-band overscroll that reveals a white void behind. */
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}
/* Chrome you never want to select by accident on a touch screen. Body text,
   notes and messages stay selectable — people need to copy those. */
.tabbar, .appbar, .modebar, .datechip, .att-buttons, .modeswitch { user-select: none; }

/* Mode switch inside the header panel. It was at the bottom of Me, past goals,
   pillars, XP and health — far enough down that Chris never found it. */
.chapterlist .switchgroup {
    border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .45rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: .25rem;
}
.chapterlist .switchlabel {
    grid-column: 1 / -1; font-size: .68rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .08em; padding: 0 .2rem .15rem;
}
.chapterlist .switchgroup form { display: contents; }
.chapterlist .switchgroup button { text-align: center; font-size: .85rem; min-height: 40px; }

/* An uploaded logo standing in for the emoji. Contained, never cropped — a
   wordmark with its sides chopped off is worse than one with space around it. */
.bizicon {
    width: 28px; height: 28px; flex: 0 0 auto;
    object-fit: contain; border-radius: 6px; background: #fff;
    vertical-align: middle;
}
.bizicon.lg { width: 44px; height: 44px; border-radius: 9px; }
.bizicon.xl { width: 72px; height: 72px; border-radius: 12px; }
/* Hero slots — a profile header, Settings, the wizard. A wordmark needs width
   more than it needs height, so give it room rather than a square. */
.bizicon.wide { width: 132px; height: 60px; border-radius: 8px; object-fit: contain; }
.attendance-sheet .bizicon { width: 26px; height: 26px; }

/* --------------------------------------------- the Members directory
   Built for a thumb and a hurry: one search box, then a tap to call. */
.searchbar { display: flex; gap: .5rem; align-items: center; }
.searchbar input[type=search] {
    flex: 1; min-width: 0; margin: 0;
    /* 16px minimum, or iOS Safari zooms the whole page on focus and the
       member never finds their way back out. */
    font-size: 16px; padding: .7rem .85rem;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--card); color: var(--ink);
}
.searchbar .btn { flex: 0 0 auto; }

.dirrow { text-decoration: none; color: inherit; }
.dirrow strong { color: var(--ink); }
.dirrow:active { background: var(--brand-soft); }

.stars { color: #b4801f; font-weight: 600; }
.stars .muted { font-weight: 400; }

/* Contact strip. Every square is a whole action, sized for a thumb (44px is
   the smallest target that doesn't get mis-tapped one-handed in a van). */
.contactbar { display: flex; gap: .5rem; flex-wrap: wrap; }
.cbtn {
    /* A quarter each, so the fifth button wraps to a matching tile instead of
       stretching across the whole second row. */
    flex: 0 1 calc(25% - .375rem); min-width: 68px; min-height: 58px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .2rem; padding: .5rem .3rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    font-size: .78rem; font-weight: 600; color: var(--ink); text-decoration: none;
}
.cbtn span { font-size: 1.15rem; line-height: 1; }
.cbtn:active { background: var(--brand-soft); }

.bullets { margin: .5rem 0 0; padding-left: 1.15rem; }
.bullets li { margin-bottom: .35rem; line-height: 1.45; }

.kv { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.kv td { padding: .5rem 0; border-bottom: 1px solid #f0ebe4; vertical-align: top; }
.kv td:first-child {
    width: 38%; color: var(--muted); font-size: .85rem; padding-right: .6rem;
}
.kv tr:last-child td { border-bottom: 0; }

/* --------------------------------------------- folded sections on Home
   Chris asked for everything minimised — "we'll click on what we want to see".
   These are the insides of a <details>, so they only ever cost height when
   somebody has actually asked for them. */
.foldhead {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); margin: 1rem 0 .35rem;
}
.foldhead:first-of-type { margin-top: .5rem; }

.foldrow {
    display: block; color: inherit; text-decoration: none;
    padding: .6rem 0; border-bottom: 1px solid #f0ebe4;
}
.foldrow:last-of-type { border-bottom: 0; }

.foldlink { color: inherit; text-decoration: none; min-height: 44px; }
.foldlink:active { background: var(--brand-soft); }

/* A whole-thumb call button sitting beside the row link, not inside it. */
.rowbtn {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px;
    display: grid; place-items: center; font-size: 1.15rem; text-decoration: none;
    background: var(--brand-soft); border: 1px solid var(--line);
}
.rowbtn:active { background: var(--brand); }

/* --------------------------------------------- the month calendar
   Chris: "have a calendar on the top instead of a list of dates to scroll
   through." Seven columns on a 375px phone leaves ~46px per square, which is
   just above the thumb-target floor — so the whole square is the link, not a
   number inside it. */
.cal { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .6rem; }
.cal-head { display: flex; align-items: center; gap: .5rem; padding: .1rem .2rem .5rem; }
.cal-head .grow { flex: 1; text-align: center; font-size: 1rem; }
.cal-nav {
    width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px;
    display: grid; place-items: center; font-size: 1.4rem; line-height: 1;
    color: var(--ink); text-decoration: none; background: var(--brand-soft);
}
.cal-nav:active { background: var(--brand); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow {
    text-align: center; font-size: .68rem; font-weight: 700; color: var(--muted);
    padding: .2rem 0 .3rem; text-transform: uppercase;
}
.cal-day {
    aspect-ratio: 1 / 1; border-radius: 9px; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; font-size: .85rem; color: var(--ink); text-decoration: none;
}
.cal-day.out { color: #c3cbbd; }          /* spill days from the neighbouring months */
.cal-day.today { outline: 2px solid var(--brand); outline-offset: -2px; font-weight: 700; }
.cal-day.has { background: var(--brand-soft); font-weight: 700; }
.cal-day.has.gone { background: #f2f4ef; color: var(--muted); }
.cal-day.has:active { background: var(--brand); }

.cal-day .dots { display: flex; gap: 2px; height: 5px; align-items: center; }
.cal-day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.cal-day.gone .dots i { background: #b9c2b1; }

.cal-key {
    display: flex; align-items: center; gap: .35rem; justify-content: center;
    padding-top: .55rem; font-size: .74rem; color: var(--muted);
}
.cal-key i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); display: inline-block; }

/* Home shows are a different kind of day from a meeting, so they get their own
   colour on the calendar rather than another green dot nobody can tell apart. */
.cal-day .dots i.show { background: var(--gold); }
.cal-day.gone .dots i.show { background: #cbbf9e; }
.cal-key { gap: .9rem; }
.cal-key span { display: inline-flex; align-items: center; gap: .35rem; }
.cal-key i.show { background: var(--gold); }
.datechip.show { background: #f9f2e0; color: #7a5c14; border-color: #e8d9ae; }

/* One day of the booth rota per fold. */
.daysheet { border-top: 1px solid var(--line); padding: .1rem 0; }
.daysheet:first-of-type { border-top: 0; }
.daysheet > summary {
    display: flex; align-items: center; gap: .6rem; cursor: pointer;
    padding: .7rem .1rem; list-style: none; min-height: 44px;
}
.daysheet > summary::-webkit-details-marker { display: none; }
.daysheet > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.daysheet[open] > summary::after { transform: rotate(180deg); }
.daysheet .rows { padding-bottom: .5rem; }

/* --------------------------------------------- the leader's graphs
   Thin marks, hairline chrome, one hue for magnitude. The status colours are
   reserved for standing and never appear without a word beside them. */

/* Horizontal bars — comparing members. Sorted worst-first by the view, so the
   people who need a conversation are at the top. */
.hbars { display: flex; flex-direction: column; gap: .3rem; margin: .4rem 0 .6rem; }
.hbar-row { display: flex; align-items: center; gap: .5rem; min-height: 26px; }
.hbar-label {
    flex: 0 0 34%; font-size: .78rem; color: var(--slate);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hbar-track {
    flex: 1; min-width: 0; height: 10px; border-radius: 99px;
    background: #eef0ec;   /* one shade off the surface — recessive, not a mark */
}
.hbar-fill {
    height: 100%; border-radius: 99px; background: var(--brand);
    min-width: 4px;        /* a 1% bar still has to be visible */
}
.hbar-value {
    flex: 0 0 3.1rem; text-align: right; font-size: .8rem; font-weight: 650;
    font-variant-numeric: tabular-nums;   /* these align down a column */
}
.hbar-row.unknown .hbar-track { background: repeating-linear-gradient(
    45deg, #f2f4f0, #f2f4f0 3px, #e8ebe5 3px, #e8ebe5 6px); }

/* Columns — turnout meeting by meeting. */
.cols {
    display: flex; align-items: flex-end; gap: 4px; margin: .5rem 0 .3rem;
    overflow-x: auto; padding-bottom: .2rem;
}
.col { flex: 1 1 0; min-width: 26px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.col-track {
    width: 100%; height: 96px; border-radius: 5px; background: #eef0ec;
    display: flex; align-items: flex-end; overflow: hidden;
}
.col-fill { width: 100%; background: var(--brand); border-radius: 5px 5px 0 0; min-height: 3px; }
/* A meeting nobody registered is a gap, never a zero. */
.col-gap { width: 100%; height: 100%; background: repeating-linear-gradient(
    45deg, #f2f4f0, #f2f4f0 3px, #e6e9e3 3px, #e6e9e3 6px); }
.col-val { font-size: .7rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.col-key { font-size: .62rem; color: var(--muted); text-align: center; line-height: 1.15; }

/* Standing mix — one stacked bar, every segment named underneath. */
.mixbar {
    display: flex; height: 12px; border-radius: 99px; overflow: hidden;
    gap: 2px;              /* a surface gap between fills, not a border */
    margin: .5rem 0 .5rem;
}
.mixbar .seg { display: block; }
.mixbar .seg.good { background: var(--good); }
.mixbar .seg.at_risk { background: var(--warn); }
.mixbar .seg.probation { background: var(--bad); }
.mixbar .seg.new { background: #b9c2b1; }
.mixkey { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .78rem; color: var(--slate); }
.mixkey span { display: inline-flex; align-items: center; gap: .35rem; }
.mixkey i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.mixkey i.good { background: var(--good); }
.mixkey i.at_risk { background: var(--warn); }
.mixkey i.probation { background: var(--bad); }
.mixkey i.new { background: #b9c2b1; }

.tabletwin > summary {
    cursor: pointer; font-size: .78rem; color: var(--muted); padding: .3rem 0;
    min-height: 30px; display: flex; align-items: center;
}

/* --------------------------------------------- the application form
   Filled in on a phone, often one-handed, often not in one sitting. */
.applywrap { max-width: 620px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.applyhead { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1.25rem; }
.applyhead img { flex: 0 0 auto; }

.stepbar { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1.25rem; }
.stepbar li { flex: 1; }
.stepbar a {
    display: flex; flex-direction: column; align-items: center; gap: .3rem;
    text-decoration: none; color: var(--muted); padding: .4rem .2rem; border-radius: 10px;
}
.stepbar .dot {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: #eef0ec; color: var(--muted); font-weight: 700; font-size: .85rem;
}
.stepbar .lbl { font-size: .72rem; text-align: center; }
.stepbar li.done .dot { background: var(--good-soft); color: var(--good); }
.stepbar li.on .dot { background: var(--brand); color: #fff; }
.stepbar li.on .lbl { color: var(--ink); font-weight: 650; }

.applyform .field { margin-bottom: 1rem; }
.applyform label { display: block; font-weight: 620; font-size: .88rem; margin-bottom: .3rem; }
.applyform .req { color: var(--bad); }
.applyform input, .applyform textarea {
    width: 100%; font: inherit;
    /* 16px minimum or iOS zooms the page on focus and the applicant is lost. */
    font-size: 16px; padding: .7rem .8rem;
    border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
.applyform input:focus, .applyform textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

/* Yes/no as a pair of buttons. Three taps beats three keyboards. */
.yesno { display: flex; gap: .5rem; }
.yesno label {
    flex: 1; min-height: 46px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 10px; background: var(--card);
    font-weight: 620; margin: 0; cursor: pointer;
}
.yesno label.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.yesno input { position: absolute; opacity: 0; width: 0; height: 0; }

.checkgrid { display: flex; flex-wrap: wrap; gap: .4rem; }
.checkchip {
    display: inline-flex; align-items: center; gap: .4rem; margin: 0;
    min-height: 42px; padding: .4rem .7rem; font-size: .82rem; font-weight: 550;
    border: 1px solid var(--line); border-radius: 99px; background: var(--card); cursor: pointer;
}
.checkchip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.checkchip input { accent-color: var(--brand); width: 16px; height: 16px; }

.applyactions { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.5rem; }

/* --------------------------------------------- the meeting agenda
   Front and centre on the meeting page: it is the page's job, not a drawer. */
.agenda { border-left: 4px solid var(--brand); }
.leadstrip {
    display: flex; align-items: center; gap: .6rem;
    background: var(--brand-soft); border-radius: 10px;
    padding: .7rem .85rem; margin-bottom: .85rem;
}
.leadstrip .big { font-size: 1.05rem; }

.agendalist, .agendaedit { margin: 0; padding-left: 1.3rem; }
.agendalist > li { padding: .7rem 0; border-bottom: 1px solid #f0ebe4; }
.agendalist > li:last-child { border-bottom: 0; }
.agendaedit > li { padding: .55rem 0; border-bottom: 1px solid #f0ebe4; }
.agendaedit > li:last-child { border-bottom: 0; }
.agendaedit .row-flex form { display: inline; }

.agendanote {
    background: var(--paper); border-radius: 8px;
    padding: .5rem .65rem; margin-top: .45rem; font-size: .88rem;
}

.agendaform { display: flex; gap: .4rem; margin-top: .5rem; }
.agendaform input {
    flex: 1; min-width: 0; font: inherit;
    /* 16px or iOS zooms the page mid-meeting, which is the worst moment for it. */
    font-size: 16px; padding: .5rem .65rem;
    border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
}
.agendaform .btn { flex: 0 0 auto; }

/* --------------------------------------------- your own booth at a show */
.boothcta .btn.big {
    min-height: 56px; font-size: 1.05rem; font-weight: 700;
}
.boothrow { flex-wrap: wrap; gap: .4rem; }
.boothrow form { display: flex; gap: .35rem; }
.staffform { flex: 1 1 160px; min-width: 0; }
.staffform input {
    flex: 1; min-width: 0; font: inherit;
    /* 16px or iOS zooms the page while you're standing in a hall. */
    font-size: 16px; padding: .4rem .6rem;
    border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
}

/* Two numbers, not four: a streak and an XP score aren't why anyone opens this. */
.pulse.two { grid-template-columns: repeat(2, 1fr); }

/* Uploading a logo. The file input itself is never shown - the label around it
   is the button, so the phone's "Choose File / No file chosen" text doesn't sit
   across the layout. Clicking the label still opens the picker. */
.logoform { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.logoform label.btn { position: relative; overflow: hidden; cursor: pointer; }
.logoform input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 0;
}

.reviewform { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .4rem 0; }
.reviewform input {
    font: inherit; font-size: 16px;   /* 16px or iOS zooms on focus */
    padding: .45rem .55rem; width: 5rem;
    border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
}
.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* Admin mode. Deliberately not the member palette: you should be able to tell
   which portal you're in from across a room, without reading a word. */
.modebar.admin {
    background: var(--anvil); border-bottom-color: #2b343d; color: #e8edf2;
}
.modebar.admin .btn { background: #fff; color: var(--anvil); border-color: transparent; }
body.app:has(.modebar.admin) .appbar { border-bottom: 3px solid var(--anvil); }

/* --------------------------------------------- schedule: calendar + day pane
   One column on a phone (calendar, then what's on it). Two side by side once
   there's room, with the calendar capped — left to itself the aspect-ratio
   squares ballooned to 150px each on a laptop and pushed everything else off
   the screen. */
.schedgrid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 860px) {
    .schedgrid { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
    .schedgrid > * { min-width: 0; }
    /* Sticky so the month stays put while the right-hand list scrolls. */
    .schedgrid .cal { position: sticky; top: 4.5rem; }
}
/* A day square never grows past a comfortable tap target, however wide the
   window is — a 150px calendar cell is a button pretending to be a billboard. */
.cal-day { max-width: 52px; max-height: 52px; margin: 0 auto; width: 100%; }
.cal-dow { max-width: 52px; margin: 0 auto; width: 100%; }

.calside { display: flex; flex-direction: column; gap: .6rem; }
.calside .card-head { margin-bottom: 0; }
.calside .sheet { margin: 0; }

/* The picked day, so the grid and the pane agree on what you're looking at. */
.cal-day.picked {
    outline: 2px solid var(--ink); outline-offset: -2px;
    background: var(--brand-soft);
}
.cal-day.picked.gone { background: #eceee9; }

.daycard { display: block; color: inherit; text-decoration: none; }
.daycard.show { border-left: 4px solid var(--gold); }
.daycard.meeting { border-left: 4px solid var(--brand); }
.daycard .go { display: inline-block; margin-top: .4rem; font-weight: 650; color: var(--brand-dark); }

/* --------------------------------------------- the Members directory
   Cards, because the question this screen answers is "should I refer them",
   and that needs trade, rating and promise visible at once. */
.memgrid {
    display: grid; gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.memcard {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: .9rem; display: flex; flex-direction: column; gap: .5rem;
}
.memtop { display: flex; gap: .75rem; align-items: flex-start; color: inherit; text-decoration: none; }
.memtop:hover { text-decoration: none; }
.memname { display: block; font-size: 1rem; line-height: 1.25; }
.memtrade { font-size: .82rem; color: var(--muted); }
.memmeta { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center;
           font-size: .78rem; margin-top: .2rem; }
.memline {
    margin: 0; font-size: .86rem; color: var(--slate); line-height: 1.4;
    /* Two lines, so every card in a row is the same height regardless of how
       chatty somebody's website is. */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.memacts { display: flex; gap: .4rem; margin-top: auto; padding-top: .2rem; }
.memact {
    flex: 1 1 0; min-height: 46px; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .12rem; font-size: .7rem; font-weight: 620;
    background: var(--brand-soft); color: var(--brand-dark); text-decoration: none;
}
.memact span { font-size: 1rem; line-height: 1; }
.memact:active { background: var(--brand); color: #fff; }
.memact:hover { text-decoration: none; }

/* The leader and topic on hover. A 50px day square can't hold either, so it
   shows on hover on a pointer device; a touch device taps through to the day
   pane, which says the same thing with room to breathe. */
.cal-day { position: relative; }
.daypop {
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    display: none; flex-direction: column; gap: .1rem;
    background: var(--ink); color: #fff; border-radius: 8px;
    padding: .45rem .6rem; width: max-content; max-width: 210px;
    font-size: .74rem; line-height: 1.3; text-align: left;
    box-shadow: 0 6px 18px -6px rgba(0,0,0,.4); z-index: 30; pointer-events: none;
}
.daypop strong { font-weight: 700; }
.daypop span { color: #cfd6c9; }
@media (hover: hover) and (pointer: fine) {
    .cal-day:hover .daypop { display: flex; }
}

/* Agenda items fold, in the same one-at-a-time group as the sections below. */
.agendaitem > summary {
    display: flex; align-items: center; gap: .5rem; cursor: pointer;
    list-style: none; padding: .55rem 0; min-height: 44px;
}
.agendaitem > summary::-webkit-details-marker { display: none; }
.agendaitem > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.agendaitem[open] > summary::after { transform: rotate(180deg); }
.agendaitem .mins { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.agendalist > li { padding: 0; }
.itemdetail { margin: 0 0 .5rem; font-size: .84rem; color: var(--muted); }

/* "I've contacted them" — the one tap that records a response time. */
.btn.answered { min-height: 46px; margin-top: .45rem; }
.answeredtag { color: var(--good); font-size: .78rem; font-weight: 650; margin-top: .35rem; }
.authhint.mismatch {
    background: var(--warn-soft); border: 1px solid #f0dcb4; color: var(--warn);
    border-radius: 10px; padding: .6rem .75rem; margin: .75rem 0 0;
}

/* Admin as a view in the header dropdown, not a bar across every screen. */
.adminchip {
    display: inline-block; background: var(--anvil); color: #fff;
    font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: .1rem .35rem; border-radius: 4px; vertical-align: middle; margin-right: .15rem;
}
.viewsplit { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .4rem; }
.viewswap {
    width: 100%; text-align: left; font: inherit; font-size: .88rem; font-weight: 620;
    padding: .6rem .7rem; min-height: 44px; cursor: pointer;
    background: var(--anvil); color: #fff; border: 0; border-radius: 8px;
}

/* The notifications switch on Home. */
.pushbox { background: var(--paper); border-radius: 10px; padding: .7rem .8rem; margin: .4rem 0; }
.pushbox .row-flex .btn { flex: 1; }

/* The one-tap alerts prompt above the feed. Removes itself once answered. */
/* The HTML `hidden` attribute must always win. The browser's own rule for it
   is weaker than any class that sets display, so `.pushnudge { display:flex }`
   was showing the "Turn on alerts" card to everyone - people who had already
   said yes, people who had blocked it, iPhones that can't take it yet - while
   the script believed it was hidden. Chris saw it every morning after turning
   alerts on. One rule, site-wide, so no other element can repeat this. */
[hidden] { display: none !important; }

.pushnudge {
    display: flex; align-items: center; gap: .6rem;
    background: var(--brand-soft); border: 1px solid var(--brand);
    border-radius: 12px; padding: .75rem .85rem; margin-bottom: .75rem;
}
.pushnudge strong { color: var(--brand-dark); }
.pushnudge small { color: var(--slate); }
.pushnudge .btn { flex: 0 0 auto; }

/* The row a notification opened, so the tap lands somewhere obvious rather
   than dropping you at the top of a list to hunt. */
:target { animation: landed 2.4s ease-out; }
@keyframes landed {
    0%, 55% { background: var(--warn-soft); }
    100% { background: transparent; }
}

/* --------------------------------------------- the MLP standard
   Four floors, each pass or fail on its own. Deliberately not a single score:
   an average lets somebody offset never turning up against giving referrals,
   and the Code of Ethics is not a menu. */
.sheet.standard { display: block; color: inherit; text-decoration: none; border-left: 4px solid var(--line); }
.sheet.standard.good { border-left-color: var(--good); }
.sheet.standard.warn { border-left-color: var(--warn); }
.sheet.standard:hover { text-decoration: none; }

.floors { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-top: .6rem; }
.floor { text-align: center; padding: .45rem .2rem; border-radius: 9px; background: #eef0ec; }
.floor .v { font-weight: 750; font-size: 1rem; letter-spacing: -.02em; }
.floor .l { font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.floor.pass { background: var(--good-soft); }
.floor.pass .v { color: var(--good); }
.floor.fail { background: var(--warn-soft); }
.floor.fail .v { color: var(--warn); }
/* No record yet is neither a pass nor a failure, and must not look like one. */
.floor.unknown .v { color: var(--muted); }

/* --------------------------------------------- the whiteboard
   Sorted by votes, so the vote is the first thing on the row. */
.boardrow { padding: .6rem .75rem; margin-bottom: .5rem; }
.boardlink { color: inherit; text-decoration: none; min-width: 0; }
.boardlink strong { display: block; }
.boardlink:hover { text-decoration: none; }

.votebtn {
    flex: 0 0 auto; width: 46px; min-height: 48px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; font: inherit; border-radius: 10px;
    background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
.votebtn .up { font-size: .7rem; line-height: 1; }
.votebtn .n { font-weight: 750; font-size: .95rem; color: var(--ink); }
.votebtn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.votebtn.on .n { color: var(--brand-dark); }

.boardnote { padding: .6rem 0; border-bottom: 1px solid #f0ebe4; }
.boardnote:last-of-type { border-bottom: 0; }

/* How far through the application somebody is — three dots, not a percentage,
   because there are three steps and a percentage would be inventing precision. */
.steps { display: flex; align-items: center; gap: .25rem; margin-top: .3rem; }
.steps i { width: 22px; height: 5px; border-radius: 99px; background: #e2e6df; }
.steps i.on { background: var(--brand); }
.steps small { margin-left: .35rem; }

/* --------------------------------------------- app feedback
   One board for the whole network. The status pill is what a member reads to
   know what happened to their idea, so each state has its own look. */
.pill.fb-new      { background: #eef2f7; color: var(--anvil); border-color: #d5dde6; }
.pill.fb-asked    { background: var(--warn-soft); color: var(--warn); border-color: #f0dcb4; }
.pill.fb-answered { background: #e8f0fb; color: #2a5d9f; border-color: #c9daf2; }
.pill.fb-planned  { background: var(--brand-soft); color: var(--brand-dark); border-color: #cfe6c3; }
.pill.fb-fixed    { background: var(--good-soft); color: var(--good); border-color: #c6e3d1; }
.pill.fb-declined { background: #f2f2f0; color: var(--muted); border-color: var(--line); }

.chipbar { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem;
           scrollbar-width: none; }
.chipbar::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem;
        padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--line);
        background: var(--card); color: var(--slate); font-size: .85rem;
        text-decoration: none; white-space: nowrap; }
.chip .n { font-weight: 700; color: var(--muted); }
.chip.on { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.chip.on .n { color: #fff; }
.chip.hot .n { color: var(--bad); }
.chip.on.hot .n { color: #ffd0c6; }

/* A reply from the App Team stands out from member replies. */
.boardnote.team { background: var(--brand-soft); border-radius: 10px;
                  padding: .6rem .75rem; margin: .35rem 0; border-bottom: 0; }

.triagebtns { display: flex; flex-wrap: wrap; gap: .4rem; }
.triagebtns .btn { flex: 1 1 auto; }

/* The Feedback button on Home and the Schedule. */
.feedbackcard { display: flex; align-items: center; gap: .7rem; }
.feedbackcard .ico { font-size: 1.6rem; line-height: 1; }

/* Settings, from every screen. */
.gearlink { flex: 0 0 auto; font-size: 1.25rem; line-height: 1; padding: .35rem;
            border-radius: 10px; text-decoration: none; }
.gearlink.on { background: rgba(255,255,255,.12); }

/* The WhatsApp message preview. */
#wa-msg { width: 100%; font-size: .85rem; line-height: 1.4; white-space: pre-wrap; }

/* Two people asked to be the same business - one of them isn't. */
.sheet.warnline { border-color: var(--warn); box-shadow: inset 4px 0 0 var(--warn); }

/* Someone is waiting to be let in: admins see this above every screen. */
.approvebar { display: flex; flex-direction: column; gap: .15rem;
              margin: 0 0 .8rem; padding: .75rem .9rem; border-radius: 12px;
              background: var(--warn-soft); border: 1px solid var(--warn);
              color: var(--ink); text-decoration: none; }
.approvebar strong { color: var(--warn); }
.approvebar span { font-size: .9rem; color: var(--slate); }
.btn.big-tap { padding: .95rem 1rem; font-size: 1.05rem; }

/* Nudges: the message Chris is about to send, and the ones he's done. */
.nudgetext { white-space: pre-wrap; font: inherit; font-size: .88rem; margin: .5rem 0 0;
             padding: .6rem .7rem; background: var(--paper); border-radius: 8px; }
.sheet.nudged { opacity: .55; }

/* --------------------------------------------- booth layout
   The floor-plan photo with a marker on each 10x10 booth. Markers are placed
   by percentage, so they land on the same booth on any screen. */
.planscroll { overflow: auto; max-height: 72vh; border-radius: 12px; -webkit-overflow-scrolling: touch; }
.planwrap { position: relative; width: 100%; border-radius: 12px; overflow: hidden;
            background: #fff; border: 1px solid var(--line); touch-action: manipulation; }
.planwrap img { display: block; width: 100%; height: auto; user-select: none; }

.spot { position: absolute; aspect-ratio: 1 / 1; transform: translate(-50%, -50%);
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        border: 2px solid var(--anvil); background: rgba(255, 255, 255, .72);
        border-radius: 4px; color: var(--ink); text-decoration: none; line-height: 1;
        font-size: clamp(8px, 1.6vw, 13px); overflow: hidden; touch-action: none; }
.spot .n { font-weight: 800; }
.spot .who { font-size: .8em; margin-top: 1px; white-space: nowrap; max-width: 100%;
             overflow: hidden; text-overflow: ellipsis; }
.spot.taken { background: rgba(238, 247, 232, .85); border-color: var(--brand-dark); }
.spot.mine { background: var(--brand); border-color: var(--brand-dark); color: #fff;
             box-shadow: 0 0 0 4px rgba(80, 150, 64, .35); z-index: 2; }
.planwrap[data-editing="1"] .spot { cursor: pointer; }
.spot { container-type: inline-size; flex-direction: row; padding: 0; }
.spot > .n { font-size: 30cqw; }
.spot.taken > .bizicon, .spot.taken > .emoji { margin-left: 15cqw; }
.spot.taken > .n { position: absolute; left: 0; top: 0; bottom: 0; width: 15cqw; display: flex;
                   align-items: center; justify-content: center; font-size: 12cqw; opacity: .7; }
.spot > .who { flex: 1 1 0; min-width: 0; margin-right: 4cqw; font-size: 9.5cqw; font-weight: 700; line-height: 1.1;
               max-width: none; text-align: left; white-space: normal; overflow-wrap: anywhere;
               display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.spot .bizicon, .spot .emoji { width: 26cqw; height: 26cqw; max-height: none; object-fit: contain; margin-right: 3cqw;
                               font-size: 20cqw; line-height: 1; flex: 0 0 auto; }
.traywrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.traywrap small { flex-basis: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px;
        border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: grab;
        touch-action: none; user-select: none; font-size: .85rem; }
.chip .bizicon { width: 22px; height: 22px; object-fit: contain; }
.chip.placed { opacity: .5; }
.picker { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; width: min(92vw, 460px);
          max-height: 80vh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
          -webkit-overflow-scrolling: touch; }

/* --------------------------------------------- tours
   One thing lit, everything else dimmed, and a card saying what it is. The
   dimming is the ring's own shadow, so the lit element stays exactly as it is. */
.tour-shield { position: fixed; inset: 0; z-index: 9997; }
.tour-ring { position: fixed; z-index: 9998; border-radius: 12px; pointer-events: none;
             box-shadow: 0 0 0 9999px rgba(10, 14, 8, .62), 0 0 0 3px var(--brand-light) inset;
             transition: left .2s, top .2s, width .2s, height .2s; }
.tour-ring.none { box-shadow: 0 0 0 9999px rgba(10, 14, 8, .62); }
.tour-card { position: fixed; z-index: 9999; width: min(340px, calc(100vw - 24px));
             background: var(--card); color: var(--ink); border-radius: 14px;
             padding: .9rem 1rem; box-shadow: 0 12px 32px rgba(0, 0, 0, .3); }
.tour-card p { margin: 0 0 .75rem; font-size: 1rem; line-height: 1.45; }
.tour-buttons { display: flex; align-items: center; gap: .5rem; }
.tour-count { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); }

/* --------------------------------------------- the meeting screen
   Read from the back of a room: one huge QR code, four short steps. */
.meetingcard { text-align: center; background: var(--card); border-radius: 16px;
               padding: 1rem 1rem 1.2rem; border: 1px solid var(--line); }
.meetingcard h1 { font-size: clamp(1.6rem, 6vw, 2.6rem); margin: .2rem 0 0; }
.meetingqr { width: min(88vw, 62vh, 560px); margin: .6rem auto; }
.meetingqr svg { display: block; width: 100%; height: auto; }
.meetingsteps { display: inline-block; text-align: left; margin: .4rem 0;
                font-size: clamp(1.05rem, 3.4vw, 1.5rem); line-height: 1.6; }
@media (min-width: 900px) {
    .meetingcard { display: grid; grid-template-columns: 1fr auto; column-gap: 2rem;
                   align-items: center; text-align: left; padding: 1.5rem 2rem; }
    .meetingcard h1, .meetingcard .lede { grid-column: 1; }
    .screen.meetingscreen { max-width: 1100px; }
    .meetingqr { grid-column: 2; grid-row: 1 / span 4; width: min(44vw, 56vh, 640px); }
    .meetingsteps, .meetingcard > .muted { grid-column: 1; }
}
@media print { .noprint, .appbar, .tabbar { display: none !important; } }

/* --------------------------------------------- booth lead form (customer-facing, tablet or phone) */
.kioskpage { background: #f6f8f2; }
.kwrap { max-width: 980px; margin: 0 auto; padding: 16px 16px 48px; }
.khead { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.khead h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.khead p { margin: 4px 0 0; color: var(--muted); }
.ktiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0; }
@media (min-width: 700px) { .ktiles { grid-template-columns: repeat(4, 1fr); } }
.ktiles.collapsed .ktile:not(.first) { display: none; }
.ktile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
         gap: 6px; min-height: 150px; padding: 12px; background: #fff; border: 3px solid var(--line);
         border-radius: 18px; text-align: center; cursor: pointer; user-select: none; }
.ktile input { position: absolute; opacity: 0; pointer-events: none; }
.ktile.on { border-color: var(--brand); background: #eef7e8; box-shadow: 0 0 0 3px rgba(80, 150, 64, .25); }
.ktile .klogo { max-width: 80%; max-height: 64px; object-fit: contain; }
.ktile .kemoji { font-size: 2.6rem; line-height: 1; }
.ktile .kname { font-weight: 800; font-size: 1.05rem; line-height: 1.15; }
.ktile .ktrade { color: var(--muted); font-size: .9rem; }
.ktile .kcheck { position: absolute; top: 8px; right: 10px; width: 28px; height: 28px; border-radius: 50%;
                 background: var(--brand); color: #fff; font-weight: 800; display: none; align-items: center;
                 justify-content: center; }
.ktile.on .kcheck { display: flex; }
.kmore { width: 100%; padding: 16px; font-size: 1.1rem; font-weight: 700; border: 2px dashed var(--brand);
         background: transparent; border-radius: 14px; color: var(--brand-dark); margin-bottom: 8px; }
.kconsent { font-size: 1rem; margin: 14px 0 4px; font-weight: 600; }
.knote { font-size: .85rem; color: var(--muted); margin: 2px 0; }
.kfields { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 14px 0; }
@media (min-width: 700px) { .kfields { grid-template-columns: 1fr 1fr; } }
.kfields label, .kdetails { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.kfields input, .kdetails textarea { font-size: 1.2rem; padding: 14px; border: 2px solid var(--line); border-radius: 12px; }
.ktime, .kstaff { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.kpick input { position: absolute; opacity: 0; }
.kpick span { display: inline-block; padding: 12px 18px; border: 2px solid var(--line); border-radius: 999px;
              background: #fff; font-weight: 700; cursor: pointer; }
.kpick input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand-dark); }
.kpick { position: relative; }
.kgo { display: block; width: 100%; margin-top: 16px; padding: 20px; font-size: 1.4rem; font-weight: 800;
       background: var(--brand); color: #fff; border: 0; border-radius: 16px; text-align: center; text-decoration: none; }
.kpriv { text-align: center; margin-top: 10px; }
.kthanks { text-align: center; padding-top: 48px; }
.kthanks h1 { font-size: 2.4rem; }
.klede { font-size: 1.3rem; }
.kbook { width: 100%; height: 640px; border: 0; border-radius: 14px; background: #fff; }

.khelp { margin: 14px 0; }
.khelpers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.khelper input { position: absolute; opacity: 0; }
.khelper { position: relative; }
.khelper span { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 120px; padding: 10px;
                border: 3px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; }
.khelper input:checked + span { border-color: var(--brand); background: #eef7e8; }
.khelper img, .khelper i { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: #dfe6d8;
                           display: flex; align-items: center; justify-content: center; font: 700 2rem system-ui; }
.workpage h2 { margin: 12px 0 6px; }
.wpeople { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.wperson { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 1.15rem; font-weight: 700;
           background: #fff; border: 3px solid var(--line); border-radius: 16px; }
.wperson img, .wface { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #dfe6d8;
                       display: flex; align-items: center; justify-content: center; font-weight: 800; }
.wnew { display: flex; flex-direction: column; gap: 10px; background: #fff; padding: 14px; border-radius: 16px; }
.wnew input[type=text], .wnew input:not([type]) { font-size: 1.3rem; padding: 14px; border: 2px solid var(--line); border-radius: 12px; }
.wphoto { font-size: .95rem; }
.wbig { width: 100%; padding: 28px; font-size: 1.6rem; font-weight: 800; border: 0; border-radius: 18px; color: #fff; }
.wbig.in { background: var(--brand); }
.wbig.out { background: #b33a2a; }
.wcount { display: flex; align-items: center; gap: 10px; background: #fff; padding: 12px; border-radius: 16px; margin-top: 12px; }
.wcount > div { flex: 1; display: flex; flex-direction: column; }
.wnum { font-size: 3.4rem; font-weight: 900; line-height: 1; }
.wlab { color: var(--muted); font-size: 1rem; }
.wplus { width: 96px; height: 96px; font-size: 2.2rem; font-weight: 900; background: var(--brand); color: #fff; border: 0; border-radius: 20px; }
.wundo, .wlink { background: transparent; border: 0; color: var(--muted); text-decoration: underline; }
.wcount.fixed .wnum { color: var(--brand-dark); }
.scorepage { background: #0e120b; color: #fff; }
.sbwrap { padding: 16px; max-width: 1800px; margin: 0 auto; }
.sbhead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sbhead h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 2.4rem); flex: 1; }
.sbtotals { display: flex; gap: 24px; }
.sbtotals div, .sbnums div { display: flex; flex-direction: column; align-items: center; }
.sbtotals b { font-size: clamp(2rem, 5vw, 4rem); line-height: 1; }
.sbtotals i, .sbnums i { font-style: normal; color: #9fb08f; font-size: .9rem; }
.sbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.sbcard { background: #1b2315; border: 3px solid #2d3a22; border-radius: 18px; padding: 14px; }
.sbcard.live { border-color: var(--brand); }
.sbcard h2 { margin: 0 0 8px; font-size: 1.3rem; }
.sbnums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sbnums b { font-size: clamp(1.8rem, 3.5vw, 3rem); line-height: 1; }
.qrpair { display: flex; gap: 24px; flex-wrap: wrap; }
.qrbox { width: 220px; height: 220px; }
.qrbox svg { width: 100%; height: 100%; }
@media print { .boothpage { page-break-after: always; } .backlink, .bottomnav, header { display: none !important; } }

.lbig { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: #fff; border-radius: 18px; padding: 16px 8px; text-align: center; }
.lbig div { display: flex; flex-direction: column; align-items: center; }
.lbig b { font-size: clamp(2.2rem, 11vw, 4.5rem); line-height: 1; font-weight: 900; }
.lbig i { font-style: normal; color: var(--muted); font-size: .8rem; }
.lbig.mine { background: #eef7e8; border: 3px solid var(--brand); }

.qrcard { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
