/* Phone-first: one column, thumb-sized controls, sheets from the bottom. */
:root {
  --paper: #f3eee4;
  --paper-2: #e9e2d3;
  --card: #fbf8f2;
  --ink: #16130e;
  --ink-2: #4b453b;
  --ink-3: #857d6d;
  --line: rgba(22, 19, 14, 0.14);
  --red: #d63c22;
  --red-soft: #fbdcd2;
  --forest: #1e4b3a;
  --forest-soft: #d5e3d8;
  --gold: #efa826;
  --gold-soft: #fae7b9;
  --display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p {
  margin: 0;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 120px;
}
.h1 {
  font: 700 30px/1.05 var(--display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h2 {
  font: 650 19px/1.2 var(--display);
  letter-spacing: -0.02em;
}
.eyebrow {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.muted {
  color: var(--ink-2);
}
.faint {
  color: var(--ink-3);
}
.small {
  font-size: 14px;
}
.tiny {
  font-size: 12.5px;
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.num {
  font: 700 28px/1 var(--display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.between {
  justify-content: space-between;
}
.wrapf {
  flex-wrap: wrap;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(243, 238, 228, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 560px;
  margin: 0 auto;
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand {
  font: 800 20px/1 var(--display);
  letter-spacing: -0.05em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
.brand i {
  width: 22px;
  height: 13px;
  position: relative;
  display: inline-block;
}
.brand i::before,
.brand i::after {
  content: '';
  position: absolute;
  top: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--red);
}
.brand i::after {
  right: 0;
  background: var(--gold);
  mix-blend-mode: multiply;
}
.iconbtn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.iconbtn:active {
  background: var(--paper-2);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.card.flush {
  padding: 0;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--ink);
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.98);
}
.btn.accent {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn.forest {
  background: var(--forest);
  border-color: var(--forest);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn.danger {
  background: transparent;
  color: #a02a14;
  border-color: rgba(160, 42, 20, 0.35);
}
.btn.block {
  width: 100%;
}
.btn.sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > span {
  font-weight: 600;
  font-size: 14px;
}
.field em {
  font-style: normal;
  color: var(--red);
}
.input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
  font-size: 16px; /* keeps iOS from zooming on focus */
}
.input:focus {
  border-color: var(--ink);
}
textarea.input {
  min-height: 110px;
  resize: vertical;
}
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}
.check input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--red);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--paper-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.forest {
  background: var(--forest-soft);
  color: var(--forest);
}
.pill.gold {
  background: var(--gold-soft);
  color: #7a4f00;
}
.pill.red {
  background: var(--red-soft);
  color: #9c2511;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chip {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 550;
  color: var(--ink-2);
}
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.note {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--gold-soft);
  color: #5c3c00;
}
.note.bad {
  background: var(--red-soft);
  color: #8a2110;
}
.note.good {
  background: var(--forest-soft);
  color: var(--forest);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat.ink {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.stat.ink .eyebrow {
  color: rgba(243, 238, 228, 0.6);
}
.bar {
  height: 6px;
  border-radius: 6px;
  background: rgba(243, 238, 228, 0.22);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.list > * + * {
  border-top: 1px solid var(--line);
}
.person {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  text-align: left;
  min-height: 64px;
}
.person:active {
  background: var(--paper-2);
}
.dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex: none;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: transparent;
}
.dot.in {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.dot.refunded {
  border-style: dashed;
}

.cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--paper-2);
}
.cover.blank {
  background: var(--forest);
  display: grid;
  place-items: end start;
  padding: 16px;
  color: var(--paper);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(22, 19, 14, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.18s;
}
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow: auto;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  animation: up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: 0 auto 14px;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
.kv {
  display: grid;
  grid-template-columns: minmax(96px, 38%) 1fr;
  gap: 8px 12px;
  font-size: 14.5px;
}
.kv dt {
  color: var(--ink-3);
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 550;
  max-width: calc(100vw - 32px);
  text-align: center;
  animation: up 0.24s;
}
.paybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(251, 248, 242, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}
.paybar > div {
  max-width: 528px;
  margin: 0 auto;
}
.tblwrap {
  overflow-x: auto;
}
.tbl {
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 100%;
}
.tbl th,
.tbl td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tbl th {
  font: 500 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.fieldrow {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------- payment page builder: two columns on a wide screen, one on a phone ---------------- */
.wrap.wide {
  max-width: 1080px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.buildbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.builder {
  display: grid;
  gap: 28px;
}
.titleinput {
  font: 600 26px/1.2 var(--display);
  padding: 14px;
}
.paycard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(22, 19, 14, 0.08);
  overflow: hidden;
  align-self: start;
}
.payrow {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--ink-2);
}
.payrow em {
  color: var(--red);
  font-style: normal;
}
.ghostinput {
  color: var(--ink-3);
  background: var(--paper);
  font-size: 14px;
}
.paystrip {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.paystrip > .tiny {
  padding: 16px 0 16px 24px;
  align-self: center;
}
.paybtn {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  padding: 16px 28px;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.gbtn {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  gap: 10px;
}
@media (min-width: 900px) {
  .builder {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 48px;
  }
  .paycard {
    position: sticky;
    top: 84px;
  }
}
