/* Hat Tip: warm paper, ink, a copper thread for thanks, three quiet colours for the three tiers.
   One bundled serif (Source Serif 4, SIL OFL, web/fonts/), no inline styles (the CSP blocks them). */

@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/source-serif-4-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4efe6;
  --paper-2: #ebe3d4;
  --card: #fffdf9;
  --ink: #1d2826;
  --ink-2: #45524f;
  --muted: #7b817b;
  --line: #e3dac9;
  --line-2: #d4c9b4;
  --teal: #1f5c58;
  --teal-2: #2a7570;
  --teal-soft: #dcebe8;
  --copper: #c4692c;
  --copper-soft: #f5e1cf;
  --t1: #3f7f57;
  --t1-soft: #e2efe5;
  --t2: #a87c12;
  --t2-soft: #f6ecd0;
  --t3: #94445a;
  --t3-soft: #f4e1e6;
  --bot: #575c84;
  --bot-soft: #e9e9f3;
  --bad: #a6402f;
  --good: #3f7f57;
  --serif: 'Source Serif 4', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 14px;
  --shadow: 0 1px 2px rgba(60, 45, 20, 0.06), 0 6px 20px rgba(60, 45, 20, 0.06);
  --wrap: 1240px;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  /* the page keeps the reader's place itself (ui.js keepView); no second correction by the browser */
  overflow-anchor: none;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.giving {
  padding-bottom: 150px;
}
a {
  color: var(--teal);
  text-underline-offset: 2px;
}
code {
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: normal;
}
/* accounts and hashes may break anywhere; words in code (Transfer, FunctionCall) only at spaces */
.drawer code,
.param-list code,
a code {
  overflow-wrap: anywhere;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
:focus-visible {
  outline: 2px solid var(--teal-2);
  outline-offset: 2px;
}
.muted {
  color: var(--muted);
}
.fine {
  font-size: 13px;
}
.good {
  color: var(--good);
}
.bad {
  color: var(--bad);
}
[hidden] {
  display: none !important;
}

.mock-badge {
  position: sticky;
  top: 0;
  z-index: 40;
  background: repeating-linear-gradient(-45deg, #fbe7c6, #fbe7c6 10px, #f7ddb2 10px, #f7ddb2 20px);
  color: #6b4a12;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 8px;
  letter-spacing: 0.02em;
}

/* ---- header ---- */
.top {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 32px 6px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.brand-word {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.community {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  font-size: 13px;
  color: var(--ink-2);
  background: rgba(255, 253, 249, 0.6);
}
.community-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--t1);
  box-shadow: 0 0 0 3px var(--t1-soft);
}
.top-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  padding: 7px 11px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 14px;
}
.nav-link:hover {
  background: var(--paper-2);
}
.btn-quiet {
  border: 1px solid var(--line-2);
  background: var(--card);
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 14px;
  color: var(--ink-2);
}
.btn-quiet:hover {
  border-color: var(--teal-2);
  color: var(--teal);
}
.proof-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--teal);
}
.ico-check {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--teal);
  position: relative;
}
.ico-check::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 3px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px 40px;
}

/* ---- hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr);
  grid-template-areas: 'text card' 'tiles card';
  grid-template-rows: auto 1fr;
  gap: 18px 40px;
  align-items: start;
  padding: 26px 0 26px;
}
.hero-text {
  grid-area: text;
}
.round-card {
  grid-area: card;
}
.kicker {
  margin: 0 0 12px;
  color: var(--copper);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  max-width: 14em;
  text-wrap: balance;
}
.lede em {
  font-style: normal;
  font-weight: 650;
  color: var(--copper);
  background: linear-gradient(transparent 62%, var(--copper-soft) 62%);
}
.lede {
  margin: 0;
  color: var(--ink-2);
  font-size: 16.5px;
  max-width: 35em;
}

/* the three tiers as tiles: the idea in three colours, with the last round's numbers */
.tiles {
  grid-area: tiles;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.tile {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 12px 10px;
  border-radius: 12px;
  background: var(--t1-soft);
  border: 1px solid transparent;
  border-top: 3px solid var(--t1);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.tile:hover {
  border-color: var(--t1);
  transform: translateY(-1px);
}
.tile.t2 {
  background: var(--t2-soft);
  border-top-color: var(--t2);
}
.tile.t2:hover {
  border-color: var(--t2);
}
.tile.t3 {
  background: var(--t3-soft);
  border-top-color: var(--t3);
}
.tile.t3:hover {
  border-color: var(--t3);
}
.tile-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
}
.tile-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: var(--t1);
  flex: none;
}
.t2 .tile-num {
  background: var(--t2);
}
.t3 .tile-num {
  background: var(--t3);
}
.tile-rule {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-2);
}
.tile-last {
  margin-top: auto;
  padding-top: 4px;
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--t1);
  min-height: 1.5em;
}
.t2 .tile-last {
  color: var(--t2);
}
.t3 .tile-last {
  color: var(--t3);
}

.round-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px 24px 20px;
}
.round-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.round-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}
.round-title b {
  color: var(--ink);
}
.round-state {
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* a small loader while the first read is on its way */
.dots {
  display: inline-block;
  width: 18px;
  height: 6px;
  background: radial-gradient(circle, var(--teal-2) 2.2px, transparent 2.6px) 0 0 / 6px 6px repeat-x;
  animation: breathe 1.2s ease-in-out infinite;
}
body.live .round-state .dots {
  display: none;
}
.countdown-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 4px 0 10px;
}
.countdown {
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.until {
  color: var(--muted);
  font-size: 14px;
}
.progress {
  height: 6px;
  border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--teal-2), var(--teal));
}
body.closing .progress-fill {
  background: var(--copper);
  animation: breathe 1.4s ease-in-out infinite;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 16px 0 18px;
}
.facts div {
  min-width: 0;
}
.facts dt {
  font-size: 12px;
  color: var(--muted);
}
.facts dd {
  margin: 1px 0 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.btn-primary {
  border: 0;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-weight: 650;
  padding: 11px 18px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 4px 14px rgba(31, 92, 88, 0.22);
  transition: background 0.15s, transform 0.08s;
}
.btn-primary:hover:not(:disabled) {
  background: var(--teal-2);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-primary:disabled {
  opacity: 0.5;
}
.give-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 13px 18px;
}
.give-title {
  font-size: 17px;
}
.give-sub {
  font-size: 12.5px;
  font-weight: 450;
  opacity: 0.85;
}
.give-btn.done {
  background: var(--card);
  color: var(--teal);
  border: 1.5px solid var(--teal);
  box-shadow: none;
}
.give-when {
  margin: 9px 2px 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-2);
}
.give-when::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 1px;
  background: var(--t1);
}
.give-when.when-mid::before {
  background: var(--t2);
}
.give-when.when-late::before {
  background: var(--copper);
}

.you {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
}
.you-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.you-acct {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.you-lines {
  margin: 8px 0 0;
  padding: 0 0 0 18px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.you-lines li {
  margin: 3px 0;
}
/* the guest's own result after a close */
.you-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fbf1e7;
  border: 1px solid var(--copper-soft);
  border-left: 3px solid var(--copper);
  font-size: 13.5px;
}
.you-result p {
  margin: 0;
}
.yr-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--copper);
}
.yr-line {
  margin-top: 2px !important;
  color: var(--ink);
}
.yr-pay {
  margin-top: 6px !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--ink-2);
}
.yr-pay b {
  font-size: 16px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.yr-pay .p-prop {
  margin-left: auto;
}
.yr-hint {
  margin-top: 4px !important;
  color: var(--ink-2);
  font-size: 12.5px;
}

/* ---- section heads ---- */
.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 34px 0 14px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-head .sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  flex: 1 1 300px;
}
.board-note {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: -6px 0 12px;
  font-size: 13px;
  color: var(--ink-2);
}
.board-note .bot-ico {
  flex: none;
  color: var(--bot);
  top: 1px;
}
.board-note.fresh {
  color: var(--ink);
}
.replay-btn {
  margin-left: auto;
}

/* ---- avatars, chips, pills ---- */
.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--serif);
}
.avatar.lg {
  width: 52px;
  height: 52px;
  font-size: 22px;
}
.av-0 {
  background: #c4692c;
}
.av-1 {
  background: #3f7f57;
}
.av-2 {
  background: #3d6a8a;
}
.av-3 {
  background: #94445a;
}
.av-4 {
  background: #a87c12;
}
.av-5 {
  background: #575c84;
}
.av-6 {
  background: #2a7570;
}
.av-7 {
  background: #85664a;
}
.av-you {
  width: auto;
  padding: 0 9px;
  height: 26px;
  border-radius: 99px;
  font-size: 12px;
  font-family: var(--sans);
  background: var(--copper);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1;
  padding: 4px 8px 4px 6px;
  border-radius: 99px;
  white-space: nowrap;
}
.chip.bot {
  background: var(--bot-soft);
  color: var(--bot);
  font-weight: 600;
}
.chip-pair,
.chip-free_rider {
  background: #f3e6d8;
  color: #8a4d1c;
}
.chip {
  max-width: 100%;
  min-width: 0;
}
.chip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-ico {
  width: 11px;
  height: 9px;
  border-radius: 3px;
  border: 1.6px solid currentColor;
  position: relative;
}
.bot-ico::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 1.5px;
  width: 2px;
  height: 2px;
  background: currentColor;
  box-shadow: 3px 0 0 currentColor;
  border-radius: 50%;
}
.bot-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 18px;
  height: 16px;
  border-radius: 5px;
  background: var(--bot-soft);
  color: var(--bot);
  vertical-align: 1px;
}
.bot-mark .bot-ico {
  width: 10px;
  height: 8px;
  border-width: 1.4px;
}
.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  vertical-align: 1px;
}
.pill.t1 {
  background: var(--t1-soft);
  color: var(--t1);
}
.pill.t2 {
  background: var(--t2-soft);
  color: var(--t2);
}
.pill.t3 {
  background: var(--t3-soft);
  color: var(--t3);
}
.pill.carry {
  background: var(--paper-2);
  color: var(--muted);
}

/* ---- member cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.member {
  padding: 15px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.member.quiet .m-recv .m-bar,
.member.quiet .m-preview {
  display: none;
}
.member.giving {
  border-color: var(--line-2);
}
.member.mine {
  border-color: var(--copper);
  box-shadow: 0 0 0 1px var(--copper-soft), var(--shadow);
}
.m-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}
.m-who {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.m-who .bot-mark {
  margin-left: 0;
}
/* a demo card: its label on a line of its own under the name, as wide as the card allows */
.member.demo .m-head {
  grid-template-areas: 'av name rep' 'av label label';
  row-gap: 3px;
}
.member.demo .m-head .avatar {
  grid-area: av;
}
.member.demo .m-who {
  display: contents;
}
.member.demo .m-name {
  grid-area: name;
}
.member.demo .m-who .chip {
  grid-area: label;
  justify-self: start;
}
.member.demo .m-record {
  grid-area: rep;
}
.m-head .m-who:has(.bot-mark) {
  flex-direction: row;
  align-items: center;
  gap: 7px;
}
/* what a demo card is there to show */
.m-role {
  margin: -2px 0 0;
  padding: 6px 9px;
  border-radius: 9px;
  background: #f6ece2;
  color: #6d3f18;
  font-size: 12.5px;
  line-height: 1.4;
}
.m-last {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-size: 13px;
  color: var(--muted);
  opacity: 0.85;
}
.m-last b {
  color: var(--ink-2);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.ml-round {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ml-note {
  flex-basis: 100%;
  font-family: var(--serif);
  font-size: 14px;
}
.member.empty-round .m-recv,
.member.empty-round .m-preview {
  display: none;
}
.member.empty-round .m-note.empty {
  min-height: 0;
  font-size: 12.5px;
}
.member.skeleton {
  min-height: 150px;
  gap: 12px;
}
.member.skeleton span {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--paper-2);
  animation: breathe 1.4s ease-in-out infinite;
}
.member.skeleton span:first-child {
  width: 45%;
  height: 16px;
}
.member.skeleton span:nth-child(2) {
  width: 80%;
}
.member.skeleton span:nth-child(3) {
  width: 60%;
}
.skeleton-line {
  height: 48px;
  border-radius: 11px;
  background: var(--paper);
  animation: breathe 1.4s ease-in-out infinite;
}
.loading-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 2px;
}
.m-name {
  font-size: 16px;
}
.m-note {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  min-height: 2.7em;
}
.m-note.empty {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--muted);
}
.m-recv-line {
  font-size: 13.5px;
  color: var(--ink-2);
}
.m-given {
  font-weight: 600;
  color: var(--ink);
}
.m-counted {
  color: var(--muted);
}
.m-bar {
  position: relative;
  margin-top: 6px;
  height: 6px;
  border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
}
.m-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 6px;
  background: #d9b48f;
  transition: width 0.3s ease;
}
.m-bar-mine {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--copper);
  transition: width 0.3s ease, left 0.3s ease;
}
.m-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}
.m-amount {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.m-preview.none .m-amount {
  color: var(--muted);
  font-weight: 450;
  font-size: 13.5px;
}
.m-why {
  position: relative;
  margin: -2px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-2);
  padding: 1px 0 1px 19px;
}
/* a small "i": why counted differs from given, said quietly */
.m-why::before {
  content: 'i';
  position: absolute;
  left: 0;
  top: 2.5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font: italic 700 9px/11px var(--serif);
  text-align: center;
}
/* copper only for the line about the visitor's own thanks */
.m-why.why-mine {
  color: #8a4d1c;
}
.m-why.why-mine::before {
  border-color: #c4692c;
  color: #c4692c;
}
.m-give {
  display: grid;
  grid-template-columns: 36px 1fr 30px 52px;
  align-items: center;
  gap: 8px;
  padding: 8px 0 2px;
  border-top: 1px dashed var(--line);
}
.chip-btn {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--card);
  font-weight: 700;
}
.chip-btn.plus {
  background: var(--copper);
  border-color: var(--copper);
  color: #fff;
}
.chip-btn.plus:hover {
  background: #b25d24;
}
.chip-btn.minus:hover {
  border-color: var(--copper);
  color: var(--copper);
}
.m-mine {
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--copper);
}
.m-range {
  width: 100%;
  accent-color: var(--copper);
}
.m-record {
  margin-left: auto;
  align-self: flex-start;
  flex: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 99px;
  padding: 2px 9px;
  font-size: 12px;
  color: var(--teal);
  white-space: nowrap;
}
.m-record:hover {
  border-color: var(--teal);
}

.guests {
  margin-top: 16px;
}
.guests-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.guest-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 10px;
}
.guest {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  font-size: 13.5px;
  background: rgba(255, 253, 249, 0.6);
}
.g-body {
  flex: 1;
  min-width: 0;
}
.g-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.guest .avatar {
  width: 28px;
  height: 28px;
  font-size: 13px;
}
.guest.me {
  border-style: solid;
  border-color: var(--copper);
  background: var(--card);
}
.g-note {
  margin: 2px 0 0;
  font-family: var(--serif);
}
.g-why {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #8a4d1c;
}
.g-pay {
  white-space: nowrap;
  font-weight: 650;
}

/* ---- the track's requirements: one line each, with the link that proves it ---- */
.reqs {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 16px 12px;
}
.reqs-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 0 0 8px;
}
.reqs-title {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}
.reqs-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.reqs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.req {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 14px;
  border-left: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.38;
  color: var(--ink-2);
}
.req:first-child {
  border-left: 0;
  padding-left: 0;
}
.req:last-child {
  padding-right: 0;
}
.req-name {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--ink);
}
.req-name .ico-check {
  flex: none;
  margin-top: 1px;
}
.req-answer .ico-check {
  background: var(--copper);
}
.req-link {
  margin-top: auto;
  padding-top: 3px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.reqs + .story {
  margin-top: 12px;
}
#board,
#payouts,
#ledger,
#rules {
  scroll-margin-top: 12px;
}

/* ---- the close story: always under the hero, plays at every close ---- */
.story {
  margin: 8px 0 0;
}
.story-inner {
  background: var(--ink);
  color: #efe9dd;
  border-radius: 18px;
  padding: 12px 14px 14px;
}
.story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 8px;
}
.story-title {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(239, 233, 221, 0.72);
}
.story-replay {
  flex: none;
  border: 1px solid rgba(239, 233, 221, 0.35);
  background: transparent;
  color: #efe9dd;
  border-radius: 99px;
  padding: 4px 12px 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.story-replay::before {
  content: '↻';
  margin-right: 6px;
}
.story-replay:hover {
  border-color: #fff;
  color: #fff;
}
.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.45fr);
  gap: 8px;
  counter-reset: none;
}
.story-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.28;
  transform: translateY(4px);
  transition: opacity 0.5s, transform 0.5s, background 0.5s;
  font-size: 13px;
  line-height: 1.4;
}
.story-step + .story-step::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 21px;
  width: 6px;
  height: 6px;
  border: solid rgba(239, 233, 221, 0.4);
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
.story-step b {
  font-size: 14px;
  color: #fff;
}
.story-step.on {
  opacity: 1;
  transform: none;
}
.story.playing .story-step.now {
  background: rgba(255, 255, 255, 0.12);
}
.story-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--copper);
  color: #fff;
}
.story-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 3px;
}
.story-chips .pill.zero {
  opacity: 0.55;
}
.story-step .story-chips .pill b {
  color: inherit;
  font-size: inherit;
  margin-left: 2px;
}
.story-state {
  display: block;
  color: rgba(239, 233, 221, 0.8);
}

/* ---- payouts in three tiers ---- */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.tier {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px 14px 10px;
  border-top: 4px solid var(--t1);
}
.tier-2 {
  border-top-color: var(--t2);
}
.tier-3 {
  border-top-color: var(--t3);
}
.tier h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
}
.tier-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  color: #fff;
  background: var(--t1);
}
.tier-2 .tier-num {
  background: var(--t2);
}
.tier-3 .tier-num {
  background: var(--t3);
}
.tier-rule {
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 13px;
  min-height: 2.6em;
}
.tier-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tier-empty {
  color: var(--ink-2);
  font-size: 13.5px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px dashed var(--line-2);
}
.tier-empty .muted {
  display: block;
  font-size: 12.5px;
}
.payout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 11px;
  background: var(--paper);
  border: 1px solid transparent;
  animation: rise 0.45s ease both;
}
.payout .avatar {
  width: 30px;
  height: 30px;
  font-size: 13px;
}
.payout.mine {
  border-color: var(--copper);
  background: #fbf1e7;
}
.payout.fresh {
  animation: flash 1.6s ease;
}
.p-main {
  flex: 1;
  min-width: 0;
}
.p-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.p-name {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 650;
  text-align: left;
}
.p-name:hover {
  color: var(--teal);
  text-decoration: underline;
}
.p-amt {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.p-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 1px;
}
/* the approvals as marks: who said yes, and what is still needed */
.p-votes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.vm {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px 0 4px;
  border-radius: 99px;
  font-size: 11.5px;
  line-height: 18px;
  white-space: nowrap;
  background: var(--t1-soft);
  color: var(--t1);
  font-weight: 600;
}
.vm-mark {
  font-weight: 800;
}
.vm.no {
  background: #f6e0dc;
  color: var(--bad);
}
.vm.open {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  font-weight: 500;
}
.p-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--t2);
  animation: breathe 1.6s ease-in-out infinite;
}
.payout.paid .p-dot {
  background: var(--t1);
  animation: none;
}
.payout.struck .p-dot {
  background: var(--bad);
  animation: none;
}
.payout.struck .p-amt {
  text-decoration: line-through;
  color: var(--muted);
}
.payout.lapsed .p-dot {
  background: var(--muted);
  animation: none;
}
.p-prop {
  flex: none;
  border: 1px solid var(--line-2);
  background: var(--card);
  border-radius: 8px;
  padding: 3px 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--teal);
}
.p-prop:hover {
  border-color: var(--teal);
}
/* ---- bounties: open, being worked on, done and paid ---- */
.bcol-open {
  border-top-color: var(--teal);
}
.bcol-work {
  border-top-color: var(--t2);
}
.bcol .tier-num {
  width: auto;
  min-width: 24px;
  padding: 0 6px;
  border-radius: 99px;
}
.bcol-open .tier-num {
  background: var(--teal);
}
.bcol-work .tier-num {
  background: var(--t2);
}
.bounty {
  align-items: flex-start;
}
.bounty .p-prop {
  margin-top: 2px;
}
.bounty .p-stage {
  flex-wrap: nowrap;
  align-items: flex-start;
}
.bounty .p-dot {
  margin-top: 5px;
}
.b-title {
  font-weight: 650;
  min-width: 0;
  overflow-wrap: anywhere;
}
.b-id {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.b-people {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.b-who {
  font-size: inherit;
}
.bounty.open .p-dot {
  background: var(--teal);
  animation: none;
}
.bounty.proposed .p-dot,
.bounty.expired .p-dot {
  background: var(--muted);
  animation: none;
}
.bounty.proposed {
  border: 1px dashed var(--line-2);
  background: transparent;
}
.bounty.done .p-dot {
  background: var(--t1);
  animation: none;
}
.b-foot {
  max-width: 78ch;
}
.req-link-2 {
  margin-top: 0;
  padding-top: 1px;
}
.carried {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 13.5px;
}
.carried-me {
  display: block;
  margin-bottom: 3px;
  color: #8a4d1c;
  font-weight: 600;
}

/* ---- the second replay: the same thanks, counted twice ---- */
:root {
  --rp-plain: #c4692c;
  --rp-rules: #008c7f;
}
.replay-host {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.replay-open-sub {
  margin-left: 12px;
  font-size: 13px;
}
/* the simulation's result, before anything plays */
.rp-result {
  margin: 0 0 14px;
}
.rp-result-lead {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  max-width: 62em;
}
.rp-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.rp-figures div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 12px 16px;
}
.rp-figures dt {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
}
.rp-figures dd {
  margin: 4px 0 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
}
.rp-from {
  font-size: 22px;
  color: var(--rp-plain);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(196, 105, 44, 0.55);
}
.rp-to-arrow {
  color: var(--muted);
  font-family: var(--sans);
}
.rp-to {
  font-size: 34px;
  font-weight: 650;
  line-height: 1;
  color: var(--rp-rules);
}
.rp-note {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
}
.rp-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.rp-play {
  min-width: 92px;
  white-space: nowrap;
  font-weight: 600;
  color: var(--teal);
}
.rp-range {
  flex: 1;
  max-width: 420px;
  accent-color: var(--teal);
}
.rp-round {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 110px;
}
.rp-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.rp-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 8px;
}
.rp-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rp-panel h3,
.rp-bigger h3 {
  margin: 0;
  font-size: 16px;
}
.rp-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--rp-plain);
}
.rp-rules .rp-swatch {
  background: var(--rp-rules);
}
.rp-panel-sub {
  margin: 3px 0 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.rp-panel .rp-panel-sub {
  min-height: 2.9em; /* both panels' rows start on the same line */
}
.rp-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rp-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 52px 46px;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13.5px;
}
.rp-who {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.rp-name {
  font-weight: 600;
}
.rp-kind {
  font-size: 11px;
  color: #8a4d1c;
}
.rp-row.kind-guests .rp-kind {
  color: var(--muted);
}
.rp-track {
  position: relative;
  height: 12px;
  border-radius: 0 4px 4px 0;
  background: var(--paper);
}
.rp-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 0 4px 4px 0;
  background: var(--rp-plain);
  transition: width 0.16s linear;
}
.rp-rules .rp-bar {
  background: var(--rp-rules);
}
.rp-row.kind-honest .rp-bar,
.rp-row.kind-guests .rp-bar {
  background: #b9b3a6;
}
.rp-tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--ink);
  transition: left 0.16s linear;
}
.rp-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rp-ex {
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.rp-ex.over {
  color: #8a3f22;
  font-weight: 650;
}
.rp-legend {
  margin: 10px 0 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.rp-sum {
  margin: 8px 0 6px;
  padding-left: 18px;
  font-size: 14px;
}
.rp-sum li {
  margin: 3px 0;
}
.rp-sum-pair,
.rp-sum-free_rider {
  font-weight: 600;
}
.rp-table summary {
  cursor: pointer;
  color: var(--teal);
  font-size: 13.5px;
  margin: 6px 0;
}
.rp-bigger {
  margin: 0;
}
.rp-cafe-head {
  margin: 0 0 4px;
  font-size: 16px;
}
.rp-dumbbell {
  width: 100%;
  height: auto;
  display: block;
}
.db-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.db-zero {
  stroke: var(--ink-2);
  stroke-width: 1;
}
.db-tick,
.db-axis {
  fill: var(--muted);
  font-size: 11px;
}
.db-label {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.db-link {
  stroke: var(--line-2);
  stroke-width: 2;
  stroke-linecap: round;
}
.db-plain {
  fill: var(--rp-plain);
  stroke: var(--card);
  stroke-width: 2;
}
.db-rules {
  fill: var(--rp-rules);
  stroke: var(--card);
  stroke-width: 2;
}
.db-val {
  fill: var(--ink-2);
  font-size: 12px;
}
.db-val-rules {
  fill: var(--ink);
  font-weight: 650;
}
.rp-key {
  display: flex;
  gap: 16px;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-2);
}
.rp-key span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: -1px;
  background: var(--rp-plain);
}
.rp-key .rp-key-rules::before {
  background: var(--rp-rules);
}
.rp-caveat {
  margin: 12px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line-2);
  font-size: 13px;
  color: var(--ink-2);
}

/* ---- ledger ---- */
.ledger-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ledger-row + .ledger-row {
  border-top: 1px solid var(--line);
}
.lr-head {
  width: 100%;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 120px 120px;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 14px;
}
.lr-head:hover:not(:disabled) {
  background: var(--paper);
}
.lr-n {
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.lr-chev {
  width: 7px;
  height: 7px;
  border: solid var(--muted);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
.ledger-row.open .lr-chev {
  transform: rotate(45deg);
}
.ledger-row.empty .lr-chev {
  visibility: hidden;
}
.ledger-legend {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 120px 120px;
  gap: 12px;
  padding: 0 17px 6px;
  font-size: 12px;
  color: var(--muted);
}
.ledger-legend > span:nth-child(3) {
  text-align: right;
}
.lt-key {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.lt-key .lt {
  min-width: 0;
  font-weight: 600;
}
.older-btn {
  white-space: nowrap;
  flex: none;
}
.lr-givers {
  color: var(--ink-2);
}
.ledger-row.empty .lr-givers {
  color: var(--muted);
}
.lr-paid {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.lr-tiers {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.lt {
  min-width: 26px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}
.lt.t1 {
  background: var(--t1-soft);
  color: var(--t1);
}
.lt.t2 {
  background: var(--t2-soft);
  color: var(--t2);
}
.lt.t3 {
  background: var(--t3-soft);
  color: var(--t3);
}
.lr-detail {
  padding: 4px 16px 14px;
  background: var(--paper);
  overflow-x: auto;
}
.gifts {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.gifts th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-2);
}
.gifts td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.gifts .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.gv {
  display: inline-block;
  margin: 1px 4px 1px 0;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12.5px;
  white-space: nowrap;
}
.lnk {
  border: 0;
  background: none;
  padding: 0;
  color: var(--teal);
  font-weight: 600;
}
.ledger-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 13px;
}

/* ---- rules ---- */
.flows {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2px 22px 14px;
  scroll-margin-top: 16px;
}
.flows-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr;
  gap: 4px 26px;
}
.flow-col h4 {
  margin: 4px 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.flow-col ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}
.flow-col li {
  margin: 5px 0;
}
.rules-body {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 8px 22px 18px;
}
.how-list {
  margin: 10px 0;
  padding-left: 20px;
}
.how-list li {
  margin: 8px 0;
  max-width: 62em;
}
.rules-h {
  font-family: var(--serif);
  font-size: 19px;
  margin: 20px 0 8px;
}
.table-wrap {
  overflow-x: auto;
}
.tier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tier-table th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 8px;
  border-bottom: 1px solid var(--line-2);
}
.tier-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.params summary {
  cursor: pointer;
  color: var(--teal);
  margin-top: 12px;
  font-size: 14px;
}
.param-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 4px 18px;
  margin: 10px 0 0;
  font-size: 13px;
}
.param-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dotted var(--line);
  padding: 3px 0;
}
.param-list dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-align: right;
}

.foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  color: var(--muted);
  font-size: 13px;
}

/* ---- the giving tray ---- */
.tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0 16px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.tray-inner {
  pointer-events: auto;
  max-width: 980px;
  margin: 0 auto;
  background: var(--ink);
  color: #f2ece1;
  border-radius: 18px;
  padding: 12px 16px 10px;
  box-shadow: 0 10px 40px rgba(29, 40, 38, 0.35);
}
.tray-meter {
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.tray-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--copper);
  border-radius: 6px;
  transition: width 0.25s ease;
}
.tray-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.tray-count {
  white-space: nowrap;
  font-size: 14px;
  min-width: 128px;
}
.tray-count b {
  font-family: var(--serif);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.tray-note-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.tray-note {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
}
.tray-note::placeholder {
  color: rgba(242, 236, 225, 0.55);
}
.tray .btn-primary {
  background: var(--copper);
  box-shadow: none;
  white-space: nowrap;
}
.tray .btn-primary:hover:not(:disabled) {
  background: #d87a3c;
}
.tray .btn-quiet {
  background: transparent;
  color: #f2ece1;
  border-color: rgba(255, 255, 255, 0.25);
}
.tray-hint {
  margin: 7px 0 0;
  font-size: 12.5px;
  color: rgba(242, 236, 225, 0.7);
}
.tray-hint.warn {
  color: #ffd2a8;
}

/* ---- toast ---- */
.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(92vw, 520px);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.toast.ok {
  background: var(--teal);
}
.toast.warn {
  background: #8a3f22;
}

/* ---- drawer ---- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(29, 40, 38, 0.35);
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(540px, 100vw);
  background: var(--card);
  box-shadow: -10px 0 40px rgba(29, 40, 38, 0.2);
  display: flex;
  flex-direction: column;
  animation: slidein 0.22s ease;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
}
.close {
  border: 0;
  background: var(--paper);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}
.drawer-body {
  overflow-y: auto;
  padding: 6px 20px 30px;
  font-size: 14px;
}
.drawer-body h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 22px 0 8px;
}
.mock-note {
  background: #fbe7c6;
  color: #6b4a12;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.proof-list,
.checks,
.tx-list,
.votes {
  list-style: none;
  margin: 0;
  padding: 0;
}
.proof-list li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.proof-list li > span:first-child {
  color: var(--muted);
}
.verdict {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 650;
  background: var(--paper);
  color: var(--ink-2);
}
.verdict.ok {
  background: var(--t1-soft);
  color: var(--t1);
}
.verdict.no {
  background: #f6e0dc;
  color: var(--bad);
}
.verdict .mark {
  margin-top: 0;
}
.verdict.ok .mark {
  background: var(--good);
}
.verdict.ok .mark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2.5px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.verdict.no .mark {
  background: var(--bad);
}
.relay-all summary {
  cursor: pointer;
  color: var(--teal);
  font-size: 13px;
  margin: 8px 0 4px;
}
.checks li {
  display: flex;
  gap: 9px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.mark {
  flex: none;
  margin-top: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  position: relative;
  background: var(--line-2);
}
.checks .ok .mark {
  background: var(--good);
}
.checks .ok .mark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2.5px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checks .no .mark {
  background: var(--bad);
}
.checks .no .mark::after {
  content: '!';
  position: absolute;
  inset: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  line-height: 15px;
}
.tx-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.tx-list .kind {
  min-width: 60px;
  font-weight: 600;
}
.tx-list .gas {
  margin-left: auto;
  color: var(--muted);
  font-size: 12.5px;
}
.votes li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.prop-desc {
  background: var(--paper);
  border-radius: 10px;
  padding: 10px 12px;
}
.prop-by {
  margin: 0 0 8px;
}
.pol-roles {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pol-role {
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--line);
}
.pol-head {
  margin: 0 0 4px;
}
.pol-name {
  font-weight: 700;
  font-size: 0.95em;
  margin-right: 4px;
}
.pol-votes {
  margin: 0 0 4px;
  padding-left: 18px;
}
.pol-votes .pill {
  margin-left: 4px;
}
.pol-perms {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.pol-perms code {
  overflow-wrap: anywhere;
}
.raw summary {
  cursor: pointer;
  color: var(--teal);
  margin-top: 16px;
}
.raw pre {
  background: var(--paper);
  border-radius: 10px;
  padding: 10px;
  font-size: 11.5px;
  overflow-x: auto;
  max-height: 340px;
}

.rec-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 6px;
}
.rec-head > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.rec-name {
  font-size: 19px;
}
.rec-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 8px;
}
.rec-facts div {
  background: var(--paper);
  border-radius: 10px;
  padding: 8px 10px;
}
.rec-facts dt {
  font-size: 11.5px;
  color: var(--muted);
}
.rec-facts dd {
  margin: 2px 0 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.spark {
  width: 100%;
  height: auto;
  display: block;
}
.spark-area {
  fill: var(--copper-soft);
}
.spark-line {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2.2;
  stroke-linejoin: round;
}
.spark-dot {
  fill: var(--copper);
}
.spark-wrap {
  position: relative;
}
.spark-max {
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--muted);
  font-size: 11.5px;
  background: rgba(255, 253, 249, 0.8);
  padding: 0 4px;
  border-radius: 4px;
}
.spark-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11.5px;
}
.rec-role {
  margin: 10px 0 0;
  padding: 8px 11px;
  border-radius: 10px;
  background: #f6ece2;
  color: #6d3f18;
  font-size: 13px;
  line-height: 1.45;
}
.rec-rounds,
.rec-payouts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rec-rounds li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.rr-head {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
}
.rr-head span {
  color: var(--t1);
  font-weight: 650;
}
.rr-from {
  margin-top: 4px;
}
.rec-payouts li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.rp-stage {
  color: var(--ink-2);
  font-size: 12.5px;
  flex: 1 1 140px;
}
.rec-payouts .struck b {
  text-decoration: line-through;
  color: var(--muted);
}

/* ---- not live, offline ---- */
body.cold .board,
body.cold .tiles,
body.cold .story,
body.cold .payouts,
body.cold .ledger,
body.cold .rules,
body.cold .facts,
body.cold .progress,
body.cold .round-title,
body.cold .nav-link {
  display: none;
}

/* ---- motion ---- */
@keyframes breathe {
  50% {
    opacity: 0.45;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes flash {
  0% {
    background: var(--copper-soft);
  }
  100% {
    background: var(--paper);
  }
}
@keyframes slidein {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- tablet and phone ---- */
@media (max-width: 1020px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: 'text' 'card' 'tiles';
    grid-template-rows: none;
    gap: 18px;
  }
  .story-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .story-step:last-child {
    grid-column: 1 / -1;
  }
  .story-step + .story-step::before {
    display: none;
  }
  .tiers {
    grid-template-columns: 1fr;
  }
  .tier-rule {
    min-height: 0;
  }
  .reqs-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 0;
  }
  .req,
  .req:first-child {
    border-left: 0;
    padding: 0 14px 0 0;
  }
  .req-answer {
    grid-column: 1 / -1;
  }
  .flows-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  body {
    font-size: 14.5px;
  }
  body.giving {
    padding-bottom: 190px;
  }
  .top {
    padding: 12px 16px 2px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  .brand-word {
    font-size: 20px;
  }
  /* the kicker names the community on a phone */
  .community {
    display: none;
  }
  .top-nav {
    gap: 2px;
  }
  .nav-link {
    padding: 6px 7px;
    font-size: 13.5px;
  }
  .proof-btn {
    padding: 6px 10px;
  }
  main {
    padding: 0 14px 30px;
  }
  .hero {
    padding: 12px 0 16px;
    gap: 16px;
  }
  .kicker {
    font-size: 11.5px;
    margin-bottom: 8px;
  }
  .hero h1 {
    font-size: 27px;
    margin-bottom: 8px;
  }
  .lede {
    font-size: 14.5px;
  }
  .tiles {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .tile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 0;
    border-left: 3px solid var(--t1);
    border-radius: 10px;
  }
  .tile.t2 {
    border-left-color: var(--t2);
  }
  .tile.t3 {
    border-left-color: var(--t3);
  }
  .tile-rule {
    display: none;
  }
  .reqs {
    padding: 9px 12px 4px;
  }
  .reqs-head {
    margin-bottom: 4px;
  }
  .reqs-list {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .req,
  .req:first-child {
    padding: 7px 0 8px;
    border-top: 1px solid var(--line);
  }
  .req:first-child {
    border-top: 0;
  }
  .req-answer {
    grid-column: auto;
  }
  /* on a phone: the name, then the line and its link run on as one paragraph */
  .req {
    display: block;
  }
  .req-name {
    margin-bottom: 2px;
  }
  .req-link {
    display: inline;
    margin-left: 4px;
    padding-top: 0;
  }
  .flows {
    padding: 2px 14px 12px;
  }
  .tile-last {
    margin: 0;
    padding: 0;
    min-height: 0;
    text-align: right;
  }
  .give-when {
    font-size: 12px;
  }
  .round-card {
    padding: 16px 16px 16px;
    border-radius: 16px;
  }
  .countdown {
    font-size: 44px;
  }
  .facts {
    margin: 12px 0 14px;
  }
  .section-head {
    margin: 26px 0 10px;
  }
  .section-head h2 {
    font-size: 22px;
  }
  .cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .member {
    padding: 12px 13px 12px;
    gap: 6px;
  }
  .m-head .avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .m-who {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 8px;
  }
  .m-note {
    min-height: 0;
    font-size: 15px;
  }
  .m-give {
    grid-template-columns: 44px 1fr 30px 58px;
  }
  .chip-btn {
    height: 40px;
  }
  .nav-link[href='#ledger'] {
    display: none;
  }
  .payout {
    padding: 8px 9px;
  }
  .tier {
    padding: 12px 12px 8px;
  }
  .story-inner {
    padding: 10px 10px 8px;
    border-radius: 16px;
  }
  .story-head {
    padding: 0 2px 6px;
  }
  .story-title {
    font-size: 11px;
  }
  .story-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .story-step {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: baseline;
    gap: 0 8px;
    padding: 5px 6px;
    background: transparent;
  }
  .story-step b {
    font-size: 13.5px;
  }
  .story-step .story-text {
    grid-column: 2;
    font-size: 12.5px;
  }
  .m-role {
    font-size: 12px;
  }
  .rp-figures {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .rp-figures div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 14px;
  }
  .rp-to {
    font-size: 26px;
  }
  .rp-from {
    font-size: 18px;
  }
  .ledger-legend {
    display: none;
  }
  /* the tier table as three stacked cards */
  .tier-table thead {
    display: none;
  }
  .tier-table,
  .tier-table tbody,
  .tier-table tr,
  .tier-table td {
    display: block;
    width: 100%;
  }
  .tier-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
  .tier-table td {
    padding: 2px 0;
    border: 0;
  }
  .tier-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 4px;
  }
  /* the ledger's open round: receiver, counted and payout in one line, the givers under it */
  .lr-detail {
    padding: 4px 10px 12px;
  }
  .lr-detail .gifts thead {
    display: none;
  }
  .lr-detail .gifts,
  .lr-detail .gifts tbody {
    display: block;
  }
  .lr-detail .gifts tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: baseline;
    gap: 2px 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .lr-detail .gifts td {
    padding: 0;
    border: 0;
  }
  .lr-detail .gifts td.from {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .lr-detail .gifts td.counted::after {
    content: ' counted';
    color: var(--muted);
    font-size: 12px;
  }
  .lr-head {
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    padding: 10px 12px;
  }
  .lr-givers {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 13px;
  }
  .lr-paid {
    display: none;
  }
  .rules-body {
    padding: 6px 14px 14px;
  }
  .tray {
    padding: 0 8px calc(8px + env(safe-area-inset-bottom));
  }
  .tray-inner {
    padding: 10px 12px 8px;
    border-radius: 16px;
  }
  .tray-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tray-count {
    min-width: 0;
    flex: 1;
  }
  .tray-note {
    order: 4;
    flex-basis: 100%;
  }
  .tray-hint {
    display: none;
  }
  .rec-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rp-panels {
    grid-template-columns: 1fr;
  }
  .rp-panel .rp-panel-sub {
    min-height: 0;
  }
  .rp-row {
    grid-template-columns: 92px minmax(0, 1fr) 44px 40px;
    gap: 6px;
    font-size: 13px;
  }
  .replay-host {
    padding: 14px 12px;
  }
  .replay-open-sub {
    display: block;
    margin: 8px 0 0;
  }
  .rp-controls {
    flex-wrap: wrap;
    gap: 8px 12px;
  }
  .rp-range {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .drawer {
    top: auto;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    width: 100vw;
  }
  .proof-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
@media (max-width: 380px) {
  /* the smallest phones keep the Give button above the fold */
  .lede-why {
    display: none;
  }
  .facts {
    gap: 6px 14px;
  }
}
