/* Donor pages: paper and ink on the mosque wall, with the yellow strip that marks dates on the printed board. */
:root {
  --paper: #fbf8f0;
  --ink: #24211d;
  --muted: #5f584e;
  --rule: #d9cfbd;
  --edge: #b3a891;
  --strip: #f1c84b;
  --danger: #9b2f22;
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
*,
::before,
::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #e9e2d3;
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
}
p {
  margin: 0;
}
a {
  color: inherit;
}
.muted {
  color: var(--muted);
  font-weight: 400;
}
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}
.amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 4px;
  font: 600 16px/1.1 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button.primary {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}
.button.secondary {
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--ink);
}
.link {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 14px var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.field {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 16px;
}
.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: 400 16px/1.3 var(--sans);
}
.field input[type="file"] {
  padding: 6px;
  font-size: 15px;
  color: var(--muted);
}
.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 9px 14px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: #f6f1e4;
  color: var(--ink);
  font: 600 15px var(--sans);
  cursor: pointer;
}
.field small,
.hint {
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
}
[aria-invalid="true"] {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 1px var(--danger);
}
.field-error {
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 16px;
  cursor: pointer;
}
.check input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--ink);
}

/* Pages that sit on the desk: checkout slip, sponsorship sheet, messages. */
.desk {
  min-height: 100dvh;
  padding: clamp(12px, 4vw, 40px) 12px 40px;
}
.slip,
.sheet {
  display: flex;
  flex-direction: column;
  max-width: 620px;
  margin: 0 auto;
  background: var(--paper);
  border-top: 8px solid var(--strip);
  box-shadow:
    0 2px 4px #0002,
    0 12px 28px #0002;
}
.sheet.narrow {
  max-width: 520px;
}
.slip-head,
.sheet-head {
  padding: 22px 24px 8px;
}
.slip-head h1 {
  margin-top: 20px;
  font-size: 28px;
}
.sheet-head h1 {
  margin-top: 14px;
  font-size: clamp(30px, 6vw, 40px);
}
.slip-body,
.sheet-body {
  display: grid;
  gap: 18px;
  padding: 10px 24px 26px;
}
.slip-foot {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 14px 24px max(16px, env(safe-area-inset-bottom));
  border-top: 1px dashed var(--edge);
  background: #f6f1e4;
}
.total {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.total span {
  color: var(--muted);
  font-size: 14px;
}
.total strong {
  font-family: var(--serif);
  font-size: 28px;
  font-variant-numeric: lining-nums;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.lines {
  margin: 0;
  padding: 0;
  list-style: none;
}
.lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--rule);
}
.lines li > :first-child {
  min-width: 0;
}
.lines a {
  padding: 12px 0;
  font-weight: 600;
}
.quiet {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 400 14px var(--sans);
  cursor: pointer;
}
.lines .add-line {
  grid-template-columns: 1fr;
  border-bottom: 0;
}
.add-line a {
  text-decoration: none;
}
.field-group {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.field-group legend {
  margin-bottom: 6px;
  padding: 0;
  font-weight: 600;
}
.anon-note {
  padding: 12px;
  border: 1px dashed var(--edge);
  border-radius: 4px;
}
.field-group:has([name="anonymous"]:checked) [data-hide-when-anonymous],
.field-group:not(:has([name="anonymous"]:checked)) .anon-note {
  display: none;
}
.note {
  color: var(--muted);
  font-size: 15px;
}
.banner {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--strip);
  background: #fdf6dc;
}
.banner a {
  font-weight: 700;
}
.banner.error {
  border-color: var(--danger);
  background: #fbeae6;
  color: var(--danger);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.institution {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.institution img {
  flex-shrink: 0;
  width: auto;
  max-width: min(260px, 60vw);
  height: 40px;
  object-fit: contain;
}
/* A sponsor's card, opened by tapping their name on the board. */
:where(button.slot) {
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.sponsor-card {
  width: min(340px, calc(100vw - 32px));
  padding: 24px 24px 20px;
  border: 0;
  border-top: 8px solid var(--strip);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 60px #0006;
  text-align: center;
}
.sponsor-card::backdrop {
  background: #0005;
}
.sponsor-name {
  margin: 8px 0 6px;
  font: 700 30px/1.15 var(--serif);
  overflow-wrap: anywhere;
}
.sponsor-amount {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 600;
}
.sponsor-card .button {
  width: 100%;
}

/* A donor's confirmed name, the first time they see it: the label drops onto the board and a pin goes in.
   It waits hidden for the script to start it, and appears anyway after a few seconds if no script runs. */
@keyframes pin-drop {
  0% {
    opacity: 0;
    translate: 0 -80px;
    scale: 1.4;
    rotate: -8deg;
    box-shadow: 0 34px 40px #0003;
  }
  55% {
    opacity: 1;
    translate: 0 3px;
    scale: 0.96;
    rotate: 1.5deg;
  }
  78% {
    translate: 0 -2px;
    scale: 1.02;
    rotate: -0.5deg;
  }
  100% {
    opacity: 1;
    translate: 0;
    scale: 1;
    rotate: 0deg;
  }
}
@keyframes pin-press {
  from {
    opacity: 0;
    scale: 2.6;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}
@keyframes pin-glow {
  from {
    box-shadow: 0 0 0 0 #f1c84bcc;
  }
  to {
    box-shadow: 0 0 0 16px #f1c84b00;
  }
}
@keyframes appear {
  to {
    opacity: 1;
  }
}
.pin-new {
  position: relative;
  z-index: 3;
  opacity: 0;
  animation: appear 0s 6s forwards;
}
.pin-new.go {
  animation:
    pin-drop 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.15) calc(var(--i, 0) * 0.35s) both,
    pin-glow 1.2s ease-out calc(var(--i, 0) * 0.35s + 0.9s);
}
.pin-new.go::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f08a74, var(--pin, #a8432c) 55%, #6e2416);
  box-shadow: 0 2px 3px #0005;
  animation: pin-press 0.3s ease-in calc(var(--i, 0) * 0.35s + 0.8s) both;
}
/* A name on the board whose payment the mosque hasn't confirmed yet: a small clock after it, in the text's own colour.
   In a space it gets its own line, centred under the name, so it never crowds or covers the name. */
.pendingMark {
  display: inline-flex;
  margin-left: 0.3em;
  vertical-align: -0.1em;
  opacity: 0.7;
}
.pendingMark .icon {
  width: 0.9em;
  height: 0.9em;
}
.slot .pendingMark {
  display: flex;
  justify-content: center;
  margin: 3px 0 0;
}
.slot .pendingMark .icon {
  width: 12px;
  height: 12px;
}
.pendingNote {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* The same name once the mosque confirms it and the clock comes off: it glows twice where it already hangs. */
.pin-done {
  position: relative;
  z-index: 3;
}
.pin-done.go {
  animation: pin-glow 1.4s ease-out 0.2s 2;
}
@media (prefers-reduced-motion: reduce) {
  .pin-new,
  .pin-new.go,
  .pin-done.go {
    opacity: 1;
    animation: none;
    outline: 3px solid var(--strip);
    outline-offset: 2px;
  }
}

/* How to reach the mosque, under the welcome on every board. */
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
/* One line under the icon and the words together, so the whole link reads as one. */
.contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pinned .contact {
  margin: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.corner {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
}
.corner a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-underline-offset: 3px;
}
.corner .lang {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--edge);
  border-radius: 18px;
  font-weight: 600;
  text-decoration: none;
}

/* A donor's sponsorship, from the slip to a confirmed gift. Every state has the same frame: three steps along the top, what
   they chose, then one block for where they are. Yellow marks the current step only; amber is waiting, green is done. */
.progress {
  display: flex;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--muted);
}
.progress li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-top: 8px;
  border-top: 3px solid var(--rule);
}
.progress li span {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--edge);
  border-radius: 50%;
}
.progress .done {
  border-top-color: var(--ink);
  color: var(--ink);
}
.progress .done span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.progress .now {
  border-top-color: var(--strip);
  color: var(--ink);
  font-weight: 600;
}
.progress .now span {
  border-color: var(--ink);
}
.summary {
  display: grid;
  gap: 2px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.summary .muted {
  font-size: 14px;
}
.summary strong {
  overflow-wrap: anywhere;
}
.pay-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: #fff;
}
.pay-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
}
.pay-head h1 {
  font-size: 28px;
}
.pay-head span {
  color: var(--muted);
  font-size: 14px;
}
.pay-head strong {
  color: var(--ink);
}
.qr {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.qr-code {
  width: min(200px, 100%);
  padding: 0;
  border: 1px solid var(--rule);
  background: #fff;
}
.qr-code:not(:disabled) {
  cursor: pointer;
}
.qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.qr figcaption,
.phone-save .hint {
  color: var(--muted);
  font-size: 14px;
}
.phone-save {
  display: grid;
  justify-items: center;
  gap: 6px;
}
.payee {
  display: grid;
  margin: 0;
}
.payee > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-top: 1px solid var(--rule);
}
.payee dt {
  width: 96px;
  flex: none;
  color: var(--muted);
  font-size: 14px;
}
.payee dd {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.payee dd.mono {
  font-size: 16px;
}
.copy {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font: 600 14px var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.facts > div:last-child {
  border-bottom: 1px solid var(--rule);
}
.instructions {
  white-space: pre-line;
}
.pay-extra summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}
.pay-extra summary::-webkit-details-marker {
  display: none;
}
.pay-extra summary::before {
  content: "+";
  width: 14px;
  color: var(--ink);
  font-size: 18px;
}
.pay-extra[open] summary::before {
  content: "−";
}
.pay-extra[open] {
  display: grid;
  gap: 14px;
}
.panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 16px;
  border-radius: 8px;
}
.panel svg {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.panel h1 {
  font-size: 28px;
  color: inherit;
}
.panel p {
  margin-top: 4px;
}
.panel.waiting {
  background: #fbe9c8;
  color: #5e3f00;
}
.panel.done {
  background: #e2efdc;
  color: #1e4d26;
}
.panel.closed {
  background: #efe9dd;
}
.voice {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.35;
}
.next h2 {
  font: 600 16px/1.45 var(--sans);
}
.next p {
  color: var(--muted);
}
.sheet-body > .button {
  justify-self: stretch;
}
/* The pinned footer: the one thing to do, with a line of small print under it. */
.stacked {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  padding-block: 12px max(12px, env(safe-area-inset-bottom));
}
.stacked > .button,
.stacked form .button {
  width: 100%;
}
.stacked .hint {
  text-align: center;
}
.foot-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.foot-row .button {
  flex: 1;
}
.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin: 0;
  font-size: 14px;
}
.page-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}
.sheet-body > .button {
  justify-self: start;
}
.back {
  justify-self: start;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

/* Television view for the hall: large, calm, readable from the back row. */
.tv-body {
  background: var(--board, #a3794f);
}
.tv {
  min-height: 100dvh;
  display: grid;
  align-content: start;
  gap: 3vh;
  padding: 5vh 6vw;
  background: var(--paper);
  border: 2vh solid var(--board, #a3794f);
}
.tv-head h1 {
  margin-top: 1vh;
  font-size: clamp(32px, 5vw, 76px);
}
.tv-date {
  margin-top: 1vh;
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 600;
}
.tv-names {
  columns: 2 22ch;
  column-gap: 5vw;
  margin: 0;
  padding: 3vh 0 0;
  border-top: 3px solid var(--strip);
  list-style: none;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 44px);
  font-weight: 600;
  font-variant-numeric: lining-nums;
}
.tv-names li {
  padding: 0.25em 0;
  break-inside: avoid;
}
.tv-anon,
.tv-dua {
  font-size: clamp(18px, 2vw, 32px);
}
.tv-dua {
  font-family: var(--serif);
  font-style: italic;
}
.tv-nav {
  display: flex;
  gap: 24px;
  font-size: 15px;
  opacity: 0.75;
}

@media (max-width: 560px) {
  .desk {
    padding: 0 0 24px;
  }
  .slip,
  .sheet {
    box-shadow: none;
    min-height: 100dvh;
  }
  .slip-head,
  .slip-body,
  .sheet-head,
  .sheet-body {
    padding-inline: 16px;
  }
  .slip-foot {
    padding-inline: 16px;
  }
  .actions {
    width: 100%;
  }
  .actions .button {
    flex: 1;
  }
  .sheet-body > .button {
    justify-self: stretch;
  }
}
/* A tax-deductible receipt's fields appear once the donor asks for one. */
.tax:not(:has(input[name="taxReceipt"]:checked)) .tax-fields {
  display: none;
}
.tax-fields {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.preline {
  white-space: pre-line;
}

/* A gift towards the overall goal, kept apart from the nights: a card like a night's, with smaller names. */
.overall {
  max-width: 780px;
  margin: 0 0 clamp(18px, 2.4vw, 30px);
  padding-bottom: 8px;
}
.overall .overall-names .label {
  font-size: 11.5px;
  padding: 4px 7px;
}

/* Every night at a glance: its share sponsored, Ramadan's last ten nights tinted, a moon on the odd ones. */
:root {
  --last-ten: color-mix(in srgb, var(--strip) 32%, #fff);
}
.jump li a,
.picker li label {
  position: relative;
  align-content: center;
  gap: 1px;
  min-height: 52px;
  line-height: 1.1;
}
.jump li a small,
.picker li label small {
  color: var(--muted);
  font: 500 11px var(--sans);
}
.jump li a[aria-current] small {
  color: inherit;
}
.jump li a.last-ten:not([aria-current]),
.picker li label.last-ten,
.day.last-ten {
  background: var(--last-ten);
}
:is(.jump, .picker, .day) .odd {
  position: absolute;
  top: 3px;
  right: 3px;
  line-height: 0;
}
.jump-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
}
.jump-key .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 1px solid var(--edge);
  background: var(--last-ten);
  vertical-align: -1px;
}
.jump-key .odd {
  position: static;
  margin-right: 4px;
  vertical-align: -1px;
}
.odd-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  font: 600 12px var(--sans);
  vertical-align: middle;
  white-space: nowrap;
}
.day .pct {
  font-size: 12px;
  font-weight: 600;
}
.night-pct {
  font-weight: 700;
}
/* The night list takes its own row and never pushes its card past the board's edge. */
.utilities .jump {
  flex: 1 1 100%;
  min-width: 0;
}
/* The footer sits on the same wall as the board, lined up with its edges: no bar of its own, just quiet text. */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 clamp(12px, 2vw, 24px) 16px;
  color: var(--muted);
  font-size: 14px;
}
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}
.site-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-underline-offset: 3px;
}
.jump-title {
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}
