/* Splitty shared styles — receipt aesthetic */
:root {
  --paper: #fffdf7;
  --ink: #1a1a1a;
  --ink-soft: #6b6b60;
  --bg: #14161b;
  --accent: #e0523a;
  --line: #d8d4c6;
  --ok: #2e7d32;
  font-size: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% -10%, #2a2e38 0%, var(--bg) 60%);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  min-height: 100vh;
  padding: 16px 10px 80px;
  display: flex;
  justify-content: center;
}
.receipt {
  width: 100%;
  max-width: 520px;
  background: var(--paper);
  border-radius: 6px 6px 14px 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  padding: 22px 18px 26px;
  position: relative;
  height: fit-content;
}
.receipt::before {
  content: "";
  position: absolute; top: -8px; left: 0; right: 0; height: 9px;
  background: linear-gradient(-45deg, transparent 33.333%, var(--paper) 33.333%, var(--paper) 66.667%, transparent 66.667%),
              linear-gradient(45deg, transparent 33.333%, var(--paper) 33.333%, var(--paper) 66.667%, transparent 66.667%);
  background-size: 14px 18px;
}
header { text-align: center; margin-bottom: 6px; }
h1 { font-size: 1.9rem; letter-spacing: .35em; margin: 0; font-weight: 800; }
h1 a { color: inherit; text-decoration: none; }
.sub { color: var(--ink-soft); font-size: .78rem; margin-top: 4px; line-height: 1.5; }
.rule { border: none; border-top: 2px dashed var(--line); margin: 14px 0; }
.section-label {
  font-size: .72rem; letter-spacing: .18em; color: var(--ink-soft);
  text-transform: uppercase; margin: 0 0 8px;
}
.hint { font-size: .75rem; color: var(--ink-soft); margin: 10px 0 0; text-align: center; line-height: 1.5; }
.hint b { color: var(--accent); }
.hint a { color: inherit; }
.error-box {
  border: 2px dashed var(--accent); color: var(--accent);
  border-radius: 12px; padding: 10px 12px; margin: 10px 0;
  font-size: .8rem; font-weight: 700; display: none;
}
.error-box.show { display: block; }
.error-box.ok { border-color: var(--ok); color: var(--ok); }

/* Buttons + inputs */
button { font: inherit; cursor: pointer; }
.btn {
  display: block; width: 100%; border: none; border-radius: 10px;
  padding: 13px 16px; font-weight: 800; font-size: 1rem;
  background: var(--ink); color: #fff;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.accent { background: var(--accent); }
.btn.ghost {
  background: transparent; color: var(--ink);
  border: 2px dashed #b9b4a4; font-weight: 700;
}
.btn.small { width: auto; padding: 7px 14px; font-size: .82rem; border-radius: 999px; }
.linklike {
  background: none; border: none; color: var(--ink-soft);
  font-size: .72rem; text-decoration: underline; display: block; margin: 14px auto 0;
}
input[type="text"], input[type="number"], select {
  font: inherit; font-size: .95rem; padding: 9px 10px;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff;
  width: 100%; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--ink); border-color: var(--ink); }

/* Account bar (create page) */
.account { display: grid; gap: 6px; margin-bottom: 12px; }
.acct-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
#tierRow, #upgradeRow { justify-content: flex-start; }
.tier-pill {
  font-size: .62rem; font-weight: 800; letter-spacing: .12em; padding: 3px 8px; border-radius: 999px;
  border: 1.5px solid var(--ink-soft); color: var(--ink-soft);
}
.tier-pill.pro { border-color: var(--accent); color: var(--accent); }
.btn.locked { background: var(--ink-soft); }
.btn.locked::after { content: "  ·  Pro"; font-weight: 400; opacity: .85; }

/* Item editor rows */
.item-row { display: flex; gap: 6px; margin-bottom: 7px; align-items: center; }
.item-row .name { flex: 1; }
.item-row .qty { width: 54px; text-align: center; padding-left: 4px; padding-right: 4px; }
.item-row .price { width: 92px; text-align: right; }
.item-row .rm {
  border: none; background: none; color: var(--ink-soft); font-size: 1.05rem;
  padding: 4px 6px; flex: none;
}
.item-row .rm:hover { color: var(--accent); }
.money-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.money-row label { flex: 1; font-size: .8rem; color: var(--ink-soft); }
.money-row input, .money-row select { width: 110px; }

/* Bill page: people chips */
#people { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 2px solid var(--pc, #888);
  color: var(--ink); background: #fff;
  border-radius: 999px; padding: 7px 12px;
  font: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: transform .08s, box-shadow .12s;
}
.chip .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--pc, #888); flex: none; }
.chip.active { background: var(--pc, #888); color: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.25); transform: scale(1.04); }
.chip.active .dot { background: #fff; }
.chip .you { font-size: .65rem; opacity: .7; font-weight: 400; }

/* Bill page: items */
.item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: transparent; font: inherit; color: inherit;
  padding: 9px 6px; border-radius: 9px; cursor: pointer;
  border: 1.5px solid transparent;
}
.item:active { background: #f1eee2; }
.item.mine { background: #fdf0ec; border-color: var(--accent); }
.item .name { flex: 1; font-size: .9rem; line-height: 1.25; }
.item .name small { display: block; color: var(--ink-soft); font-size: .72rem; }
.item .who { display: flex; gap: 6px; flex: none; padding-right: 4px; }
.avatar {
  width: 22px; height: 22px; border-radius: 50%; color: #fff;
  font-size: .62rem; font-weight: 800; display: inline-flex;
  align-items: center; justify-content: center; flex: none;
  border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.item .price { flex: none; font-size: .9rem; font-weight: 700; min-width: 62px; text-align: right; }
.item .split-tag { flex: none; font-size: .68rem; color: var(--accent); font-weight: 800; white-space: nowrap; }
.item:focus-visible { outline: 2px solid var(--ink); }
.avatar { position: relative; }
.avatar .units {
  position: absolute; right: -7px; bottom: -6px; font-style: normal; font-size: .52rem; font-weight: 800;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 0 3px; line-height: 1.3; border: 1px solid #fff;
}
/* How-many stepper on multi-quantity lines you've claimed */
.stepper { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.stepper button {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--accent); background: #fff;
  color: var(--accent); font: inherit; font-size: 1rem; font-weight: 800; line-height: 1; padding: 0;
}
.stepper button:disabled { opacity: .35; }
.stepper b { min-width: 18px; text-align: center; font-size: .85rem; color: var(--accent); }

/* Totals */
.trow { display: flex; justify-content: space-between; font-size: .92rem; padding: 3px 4px; }
.trow.big { font-size: 1.15rem; font-weight: 800; padding-top: 8px; }
.trow .lab { color: var(--ink-soft); }
.trow.big .lab { color: var(--ink); }
.person-card {
  border: 2px solid var(--pc, #888); border-radius: 12px;
  padding: 10px 12px; margin: 10px 0; background: #fff;
}
.person-card h3 { margin: 0 0 4px; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.person-card h3 .owes { margin-left: auto; font-size: 1.1rem; }
.person-card .mini { font-size: .74rem; color: var(--ink-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; }
.person-card ul { margin: 6px 0 0; padding: 0 0 0 2px; list-style: none; font-size: .74rem; color: var(--ink-soft); }
.person-card li { display: flex; justify-content: space-between; }
/* Settle up */
.person-card.paid { border-style: dashed; background: #fbfaf4; }
.person-card.paid h3 .owes { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-soft); }
.paid-badge {
  font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ok); border: 1.5px solid var(--ok); border-radius: 999px; padding: 1px 7px;
}
.paid-badge.host { color: var(--ink-soft); border-color: var(--line); }
.pay-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 9px; }
.paylink {
  display: inline-flex; align-items: center; text-decoration: none;
  font-weight: 800; font-size: .74rem; padding: 6px 11px; border-radius: 999px;
  color: #fff; background: var(--ink); white-space: nowrap;
}
.paylink.venmo { background: #008cff; }
.paylink.cashapp { background: #00b544; }
.paylink.paypal { background: #003087; }
.paylink:active { transform: scale(.97); }
.paidbtn {
  margin-left: auto; background: transparent; color: var(--ink-soft);
  border: 1.5px dashed #b9b4a4; border-radius: 999px; padding: 5px 10px;
  font-size: .72rem; font-weight: 700;
}
.paidbtn:hover { color: var(--ink); border-color: var(--ink); }
.paidbtn.undo { color: var(--ok); border-color: var(--ok); }
#settleBar { margin-top: 10px; }
#settleBar .hint:empty { display: none; }
details.payd summary {
  cursor: pointer; font-size: .8rem; font-weight: 700; color: var(--ink);
  list-style: none; padding: 4px 0;
}
details.payd summary::-webkit-details-marker { display: none; }
details.payd summary .opt { color: var(--ink-soft); font-weight: 400; }
details.payd[open] summary { margin-bottom: 4px; }

.banner {
  border: 2px dashed var(--accent); color: var(--accent);
  border-radius: 12px; padding: 10px 12px; margin: 10px 0;
  font-size: .85rem; font-weight: 700; display: flex; justify-content: space-between; gap: 8px;
}
.banner.ok { color: var(--ok); border-color: var(--ok); }
.banner.info { color: var(--ink-soft); border-color: var(--line); }

/* Status pill (connection) */
.conn { position: fixed; top: 8px; right: 10px; font-size: .68rem; padding: 4px 10px; border-radius: 999px; background: #0008; color: #9f9; z-index: 10; display: none; }
.conn.off { display: block; color: #fc6; }

.barcode {
  margin: 14px auto 0; height: 38px; width: 200px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 9px, var(--ink) 9px 12px, transparent 12px 14px);
  opacity: .8;
}
.footer-note { text-align: center; color: var(--ink-soft); font-size: .7rem; margin-top: 18px; line-height: 1.5; }
.hidden { display: none !important; }

/* Legal pages (terms, privacy) */
.legal { font-size: .82rem; line-height: 1.55; overflow-wrap: anywhere; }
.legal .meta { color: var(--ink-soft); font-size: .72rem; margin: 0 0 4px; }
.legal h2 {
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  margin: 22px 0 8px; padding-top: 12px; border-top: 2px dashed var(--line);
}
.legal p { margin: 0 0 10px; }
.legal ul, .legal ol { margin: 0 0 10px; padding-left: 20px; }
.legal li { margin-bottom: 5px; }
.legal a { color: var(--accent); }
.legal code { font-size: .78rem; background: #f1eee2; padding: 1px 4px; border-radius: 4px; white-space: nowrap; }
.legal table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 10px; font-size: .76rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 5px 6px; border-bottom: 1px dashed var(--line); }
.legal th { color: var(--ink-soft); font-weight: 700; }
.footer-note a { color: inherit; }
