/* MakanSplit web claiming page. Colours match the app's Brand (Theme.swift). */
:root {
  --mango: #FFB547;
  --coral: #FF7A59;
  --ink: #3B2A2A;
  --teal-text: #12857B;
  --teal-soft: rgba(18, 133, 123, 0.1);
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --text: #1C1C1E;
  --muted: #6C6C72;
  --line: rgba(60, 60, 67, 0.16);
  --warn: #C2410C;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --teal-text: #5ED8CC;
    --teal-soft: rgba(94, 216, 204, 0.14);
    --bg: #000000;
    --card: #1C1C1E;
    --text: #F2F2F7;
    --muted: #A1A1A8;
    --line: rgba(235, 235, 245, 0.16);
    --warn: #FF9F7A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --teal-text: #5ED8CC;
  --teal-soft: rgba(94, 216, 204, 0.14);
  --bg: #000000;
  --card: #1C1C1E;
  --text: #F2F2F7;
  --muted: #A1A1A8;
  --line: rgba(235, 235, 245, 0.16);
  --warn: #FF9F7A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
main {
  max-width: 520px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px 24px;
}
button { font: inherit; color: inherit; }
h1, h2 { margin: 0; }
h2 { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

.loading { display: grid; place-items: center; gap: 8px; padding-top: 30vh; color: var(--muted); }
.loading img { animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .loading img { animation: none; } }

/* Header */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 132px;
  padding: 18px 20px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--mango), var(--coral));
  color: var(--ink);
}
.hero-text { position: relative; z-index: 1; padding-right: 84px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; opacity: 0.7; }
.hero h1 { font-size: 26px; line-height: 1.15; font-weight: 800; overflow-wrap: anywhere; }
.hero-sub { margin: 6px 0 0; font-weight: 600; opacity: 0.85; }
.hero-bowl { position: absolute; right: -10px; top: 14px; width: 108px; transform: rotate(10deg); }

.switch {
  display: block;
  margin: 10px 4px 0 auto;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--teal-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.card {
  margin-top: 14px;
  padding: 16px;
  border-radius: 22px;
  background: var(--card);
}
.card > h2 + .muted { margin: 4px 0 0; }
.message { margin-top: 20vh; text-align: center; }
.message h2 { margin-top: 8px; }

/* Who are you? */
.people { display: grid; gap: 8px; margin-top: 14px; }
.person {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.person:active { background: var(--teal-soft); }
.person-name { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.badge { padding: 2px 8px; border-radius: 99px; background: var(--teal-soft); color: var(--teal-text); font-size: 13px; font-weight: 700; }
.tick { color: var(--teal-text); font-weight: 800; }
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

/* Items */
.items { list-style: none; margin: 10px 0 0; padding: 0; }
.item + .item { border-top: 1px solid var(--line); }
.item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 8px 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
div.item-main { cursor: default; }
.item-text { display: grid; flex: 1; min-width: 0; }
.item-name { font-weight: 500; overflow-wrap: anywhere; }
.qty { color: var(--muted); font-weight: 600; font-size: 15px; }
.item-detail { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.item.mine .item-name { font-weight: 700; }
.check {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  transition: background 0.15s, border-color 0.15s;
}
.check.on { border-color: var(--teal-text); background: var(--teal-text); }
.stepper { display: flex; align-items: center; gap: 2px; flex: none; border-radius: 12px; background: var(--teal-soft); }
.stepper button {
  width: 40px;
  height: 36px;
  border: 0;
  background: none;
  color: var(--teal-text);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
}
.stepper button:disabled { opacity: 0.3; cursor: default; }
.count { min-width: 18px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Birthday */
.birthday label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; cursor: pointer; }
.birthday p { margin: 4px 0 0; }
.birthday input {
  appearance: none;
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 99px;
  background: var(--line);
  cursor: pointer;
  transition: background 0.2s;
}
.birthday input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.birthday input:checked { background: #34C759; }
.birthday input:checked::after { transform: translateX(20px); }

/* Your share */
.row-button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.row-button h2 { flex: 1; }
.amount-small { font-weight: 700; font-variant-numeric: tabular-nums; }
.chevron { color: var(--muted); }
.breakdown { margin-top: 10px; }
.breakdown hr { border: 0; border-top: 1px dashed var(--line); margin: 8px 0; }
.amount-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--muted); }
.amount-row .num { color: var(--text); }
.item-row { color: var(--text); }
.total-row { color: var(--text); font-weight: 800; font-size: 18px; }
.paynow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.paynow p { margin: 0 0 8px; }
.copy-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 8px; padding: 6px 0; }
.copy {
  padding: 6px 12px;
  border: 0;
  border-radius: 99px;
  background: var(--teal-soft);
  color: var(--teal-text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* Receipt photo */
.receipt-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.receipt-card p { margin: 2px 0 0; }
.receipt-card > div { flex: 1; min-width: 0; }
.receipt-card.no-photo { cursor: default; align-items: flex-start; }
.receipt-icon { font-size: 22px; }
.receipt-thumb {
  flex: none;
  width: 56px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  background: #fff;
}
.receipt-viewer { padding-bottom: 24px; }
.receipt-viewer-bar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  background: var(--bg);
}
.receipt-viewer img { display: block; width: 100%; border-radius: 12px; background: #fff; }
.receipt-viewer p { text-align: center; }

.footer { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.spacer { height: 96px; }

/* Sticky bottom: what you owe */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.bottom-bar > div { display: grid; }
.amount { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.save-state { color: var(--muted); font-size: 14px; text-align: right; max-width: 55%; }
.save-state.saved { color: var(--teal-text); font-weight: 600; }
.save-state.error { color: var(--warn); }

button:focus-visible, input:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 2px; }
