/* Be the Light Headquarters, built to pictures-1202 (his yes Wed 12/2 5:55 PM). Phone first. */
:root {
  --bg: #FBF7F0; --card: #FFFFFF; --ink: #14285A; --ink2: #3C4A6B; --soft: #6B7590; --line: #ECE4D6;
  --navy: #14285A; --navy2: #0E1D44; --orange: #E8702A; --orange2: #F28C45; --glow: rgba(242, 160, 70, .55);
  --green: #1F7A3A; --green-bg: #DDF0E1; --chip: #F2ECE2; --shadow: 0 6px 20px rgba(20, 40, 90, .08), 0 1px 3px rgba(20, 40, 90, .06);
  --tabh: 68px; --r: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0B1226; --card: #141D38; --ink: #EEF1F8; --ink2: #C9D0E2; --soft: #98A2BC; --line: #26314F;
    --navy: #14285A; --navy2: #0A1534; --chip: #1E2945; --green: #6BD08A; --green-bg: #173826;
    --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  }
}
:root[data-theme=dark] {
  --bg: #0B1226; --card: #141D38; --ink: #EEF1F8; --ink2: #C9D0E2; --soft: #98A2BC; --line: #26314F;
  --navy: #14285A; --navy2: #0A1534; --chip: #1E2945; --green: #6BD08A; --green-bg: #173826; --shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 "Avenir Next", "Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
.bsd { position: absolute; top: 14px; right: 16px; font-size: 14px; color: var(--ink2); }
.muted { color: var(--soft); }
.err { color: #C0392B; min-height: 1.2em; margin: 8px 0 0; font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .err { color: #FF8A7A; } }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(120% 70% at 50% 0%, rgba(242, 160, 70, .18), transparent 60%), var(--bg); }
.signin-card { position: relative; width: 100%; max-width: 400px; background: var(--card); border-radius: 24px; padding: 32px 22px 24px; box-shadow: var(--shadow); }
.signin-logo { width: 220px; height: auto; display: block; margin: 8px 0 4px; }
.signin h1 { font-size: 30px; margin: 4px 0 18px; letter-spacing: -.5px; }
label { display: block; font-weight: 600; font-size: 15px; margin: 12px 0 6px; color: var(--ink2); }
input, select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 17px; min-height: 48px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--orange2); outline-offset: 2px; }

/* ---------- buttons and chips ---------- */
.btn { border: 0; border-radius: 12px; padding: 12px 18px; min-height: 46px; font-weight: 700; font-size: 16px; cursor: pointer; }
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:active { background: #CF5F1F; }
.btn.green { background: var(--green); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .btn.green { background: #1F7A3A; } }
.btn.outline { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn.ghost { background: var(--chip); color: var(--ink); }
.btn.small { min-height: 38px; padding: 7px 14px; font-size: 15px; border-radius: 10px; }
.btn.link { background: none; color: var(--orange); padding: 8px 0; min-height: 44px; font-weight: 700; }
.btn.wide { width: 100%; margin-top: 16px; }
.btn[disabled] { opacity: .55; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; background: var(--chip); color: var(--ink); white-space: nowrap; }
.chip.soft { font-weight: 500; }
.chip.orange { background: var(--orange); color: #fff; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { border: 0; flex: 0 0 auto; min-height: 42px; padding: 8px 18px; border-radius: 14px; background: var(--chip); font-weight: 700; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 40, 90, .08); cursor: pointer; }
.chips button[aria-pressed=true] { background: var(--orange); color: #fff; }

/* ---------- frame ---------- */
#app { min-height: 100vh; padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 12px); }
.top { position: relative; padding: calc(10px + env(safe-area-inset-top)) 16px 4px; max-width: 640px; margin: 0 auto; }
.top .logo { width: 150px; height: auto; display: block; }
.top .bsd { top: calc(14px + env(safe-area-inset-top)); }
.titlebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; }
.titlebar h1 { font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -.6px; font-weight: 800; }
.banner { background: #FFF1E2; color: #7A3A0A; border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .banner { background: #3A2614; color: #FFD3AE; } }
main { max-width: 640px; margin: 0 auto; padding: 0 16px; outline: none; }

/* ---------- the hero: navy with candlelight ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 24px; padding: 26px 22px 30px; text-align: center;
  background:
    radial-gradient(60% 55% at 50% 38%, var(--glow), rgba(242, 160, 70, 0) 70%),
    radial-gradient(140% 90% at 50% 120%, #0A1636, transparent 60%),
    linear-gradient(180deg, #1A3068 0%, var(--navy) 55%, var(--navy2) 100%);
  box-shadow: 0 14px 30px rgba(14, 29, 68, .28);
}
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 4px 4px; mix-blend-mode: overlay; }
.hero .label { letter-spacing: .32em; font-weight: 800; font-size: 15px; opacity: .95; }
.hero .big { font-size: clamp(46px, 15vw, 76px); font-weight: 800; letter-spacing: -2px; line-height: 1.02; margin: 6px 0 4px;
  text-shadow: 0 2px 24px rgba(255, 190, 110, .35); font-variant-numeric: tabular-nums; }
.hero .of { font-size: 19px; font-weight: 600; }
.hero .sub { font-size: 15px; opacity: .92; margin-top: 10px; }
.hero.withtiles { padding-bottom: 72px; }
.bar { height: 14px; border-radius: 8px; background: rgba(255, 255, 255, .22); overflow: hidden; display: flex; margin: 16px 6px 4px; }
.bar i { display: block; height: 100%; }
.bar .a { background: linear-gradient(90deg, var(--orange), var(--orange2)); }
.bar .b { background: rgba(242, 140, 69, .38); }
.stack { height: 16px; border-radius: 8px; overflow: hidden; display: flex; margin: 16px 0 10px; background: rgba(255, 255, 255, .2); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 14px; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: -52px 4px 0; position: relative; z-index: 1; }
.tile { background: var(--card); border-radius: 16px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); min-width: 0; }
.tile b { display: block; font-size: clamp(16px, 4.9vw, 24px); font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.tile .t { font-weight: 700; font-size: 14px; color: var(--ink2); }
.tile .n { font-size: 14px; color: var(--soft); }
button.tile { border: 0; cursor: pointer; color: inherit; }

.band { display: grid; grid-template-columns: repeat(3, 1fr); color: #fff; border-radius: 20px; padding: 14px 6px; text-align: center;
  background: radial-gradient(50% 120% at 50% 50%, rgba(242, 160, 70, .45), transparent 70%), linear-gradient(180deg, #1A3068, var(--navy2));
  box-shadow: 0 10px 24px rgba(14, 29, 68, .25); margin-bottom: 14px; }
.band div + div { border-left: 1.5px solid rgba(255, 255, 255, .35); }
.band .t { font-weight: 700; font-size: 14px; opacity: .92; }
.band b { display: block; font-size: clamp(17px, 5vw, 26px); font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 16px 16px; margin: 14px 0; box-shadow: var(--shadow); }
.card h2 { font-size: 22px; margin: 0 0 8px; letter-spacing: -.3px; display: flex; align-items: center; gap: 10px; font-weight: 800; }
.card h2 .chip { font-size: 15px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); min-height: 48px; }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 14px; color: var(--soft); }
.row .amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chbar { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.chbar:first-of-type { border-top: 0; }
.chbar .track { height: 12px; border-radius: 6px; background: var(--chip); overflow: hidden; }
.chbar .track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--orange), var(--orange2)); }
.chbar .l { font-weight: 700; }
.chbar .v { font-weight: 800; font-variant-numeric: tabular-nums; }

/* pledges */
.pledge { background: var(--card); border-radius: var(--r); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.pledge .head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pledge .who { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.pledge .amt { font-size: 22px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pledge .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.pledge .src { color: var(--soft); font-size: 14px; }
.pledge .note { color: var(--ink2); font-size: 14px; margin-top: 6px; }
.pledge .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pledge .done { display: flex; justify-content: flex-end; margin-top: 8px; }

/* outreach */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-radius: 16px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 14px; }
.seg button { border: 0; background: none; min-height: 44px; border-radius: 12px; font-weight: 700; color: var(--ink); cursor: pointer; font-size: 15px; padding: 0 2px; }
.seg button[aria-pressed=true] { background: var(--orange); color: #fff; }
.ring { width: 190px; height: 190px; margin: 6px auto 4px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-weight: 800; font-size: 26px; line-height: 1.15; }
.ring .c small { display: block; font-size: 16px; font-weight: 600; opacity: .9; }
.hero.attached { border-radius: 24px 24px 0 0; margin-bottom: 0; }
.card.attached { border-radius: 0 0 var(--r) var(--r); margin-top: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
table.links { width: 100%; border-collapse: collapse; font-size: 15px; }
table.links th { text-align: right; color: var(--ink2); font-size: 14px; padding: 6px 4px; font-weight: 700; }
table.links th:first-child, table.links td:first-child { text-align: left; }
table.links td { padding: 9px 4px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; vertical-align: top; }
table.links td:first-child { font-weight: 700; }

/* site: switches */
.sw { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--ink2); }
.sw input { position: absolute; opacity: 0; width: 52px; height: 30px; margin: 0; cursor: pointer; }
.sw span.track { width: 52px; height: 30px; border-radius: 15px; background: #D8D2C8; position: relative; transition: background .15s; }
.sw span.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.sw input:checked + span.track { background: var(--orange); }
.sw input:checked + span.track::after { transform: translateX(22px); }
.sw input:focus-visible + span.track { outline: 3px solid var(--orange2); outline-offset: 2px; }
.cgift { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cgift:first-of-type { border-top: 0; }
.cgift .name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cgift .amt { font-weight: 800; }
.cgift.hidden .name, .cgift.hidden .amt { opacity: .45; text-decoration: line-through; }
.formgrid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.pick button { border: 0; border-radius: 12px; min-height: 42px; padding: 8px 16px; background: var(--chip); font-weight: 600; cursor: pointer; color: var(--ink); }
.pick button[aria-pressed=true] { background: var(--orange); color: #fff; }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 700; min-height: 52px; }
.foot { text-align: center; color: var(--soft); font-size: 14px; margin: 8px 0 0; }
.fab { position: fixed; right: max(16px, calc(50% - 304px)); bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 14px); display: flex; align-items: center; gap: 12px; z-index: 5; border: 0; background: none; cursor: pointer; font-weight: 800; font-size: 18px; color: var(--ink); }
.fab i { width: 58px; height: 58px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 34px; font-weight: 400; box-shadow: 0 8px 18px rgba(232, 112, 42, .45); }
.fab span { background: var(--bg); border-radius: 10px; padding: 2px 6px; }
.pad { padding: 24px 16px; }
.empty { color: var(--soft); padding: 8px 0; }
details > summary { cursor: pointer; color: var(--orange); font-weight: 700; min-height: 44px; display: flex; align-items: center; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.taps .row .meta { white-space: normal; }

/* ---------- tab bar ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  padding: 8px max(10px, calc(50% - 310px)) calc(8px + env(safe-area-inset-bottom)); background: var(--navy); box-shadow: 0 -6px 18px rgba(14, 29, 68, .25); }
.tabs button { border: 0; background: none; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; border-radius: 14px; font-weight: 600; font-size: 13px; cursor: pointer; }
.tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabs button[aria-current=page] { background: var(--orange); }

/* ---------- sheet and toast ---------- */
.sheet { border: 0; padding: 0; width: min(560px, 100%); max-width: 100%; margin: auto auto 0; border-radius: 24px 24px 0 0; background: var(--card); color: var(--ink); max-height: 92vh; }
.sheet::backdrop { background: rgba(8, 16, 40, .55); }
.sheet form { padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet h2 { margin: 0 0 6px; font-size: 22px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 18px); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 30; transition: all .2s; max-width: calc(100% - 32px); pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 700px) { .top .logo { width: 170px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

summary.h2sum { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
summary.h2sum::after { content: 'Open'; margin-left: auto; font-size: 15px; color: var(--orange); }
details[open] > summary.h2sum::after { content: 'Close'; }

/* counter rows: name and amount on top, switches below (names were cut at 390 px) */
.cgift { grid-template-columns: auto auto 1fr; grid-template-areas: "n n a" "s1 s2 h"; row-gap: 8px; column-gap: 18px; }
.cgift .name { grid-area: n; white-space: normal; }
.cgift .amt { grid-area: a; text-align: right; }
.cgift > .sw:nth-of-type(1) { grid-area: s1; flex-direction: row; gap: 8px; font-size: 14px; }
.cgift > .sw:nth-of-type(2) { grid-area: s2; flex-direction: row; gap: 8px; font-size: 14px; }
.cgift > .btn.link { grid-area: h; justify-self: end; }
.titlebar { flex-wrap: wrap; }
.titlebar h1 { font-size: clamp(26px, 7.6vw, 30px); }
/* dark: the logo's navy words need a light plate (the real file, never recoloured) */
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .top .logo, :root:not([data-theme=light]) .signin-logo { background: #FBF7F0; border-radius: 12px; padding: 6px 10px; } }
:root[data-theme=dark] .top .logo, :root[data-theme=dark] .signin-logo { background: #FBF7F0; border-radius: 12px; padding: 6px 10px; }
/* contrast: white on the button orange at 4.5 to 1 or better (Fable fix-soon) */
.btn.primary, .chips button[aria-pressed=true], .seg button[aria-pressed=true], .pick button[aria-pressed=true], .tabs button[aria-current=page], .chip.orange { background: #B84F16; }
.btn.primary:active { background: #A84612; }
