/* public/assets/ct-split.css — the Split participant page
   ---------------------------------------------------------------------------
   Markup comes from public/assets/split/splitlink-page-core.js (server first
   paint, browser redraws); behaviour from public/assets/ct-split.js. Every
   colour is a token, and a section card that carries a paper look
   (.ct-paper[data-look], from ct-looks.css) reads the --look-* variables, so
   the page follows the chat card. Loaded by functions/tools/splitlink. */

/* ================= Section cards ================= */
.spSection {
  --sp-head: var(--look-head, var(--text));
  --sp-text: var(--look-text, var(--text));
  --sp-muted: var(--look-muted, var(--muted));
  --sp-rule: var(--look-rule, var(--ring));
  /* --look-mark already resolves to the card's exact mark on the looks whose
     marks follow the theme (Sticky, Blueprint) and follows dark mode on the
     rest; preferring --look-mark-exact kept a light-mode green on dark paper. */
  --sp-mark: var(--look-mark, var(--accent));
  /* The accent as text (amounts owed, the progress count): a mark colour is
     only tuned for fills, so on a look it reads the text-safe accent the
     look clears against its ground (--look-accent-text). The default look,
     which has no paper, keeps the mark as before. */
  --sp-ink: var(--look-accent-text, var(--sp-mark));
  --sp-track: var(--look-track, color-mix(in srgb, var(--accent) 14%, var(--card)));
  --sp-soft: var(--look-quote-bg, color-mix(in srgb, var(--accent) 8%, var(--card)));
  --sp-surface: var(--look-surface, var(--card));
  margin-top: 12px;
  padding: 14px 16px 16px;
  border: 1px solid var(--ring);
  border-radius: var(--radius-xl, 20px);
  background: var(--card);
  color: var(--sp-text);
  box-shadow: var(--shadow-xs);
}
.spSection.ct-paper { padding-left: 24px; box-shadow: none; }
.spHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.spHead h2 { margin: 0; font-size: 1.05rem; font-weight: 750; letter-spacing: -.01em; color: var(--sp-head); }
.spHead .spHeadSub { font-size: .8rem; color: var(--sp-muted); font-weight: 500; }
.spHeadActions { display: flex; gap: 8px; align-items: center; }
.spSub { margin: 14px 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .01em; color: var(--sp-muted); }
.spEmpty { margin: 4px 0 0; padding: 12px 0 2px; font-size: .92rem; color: var(--sp-muted); }
.spEmpty--ok { color: var(--sp-ink); font-weight: 600; }
.spLatest { display: block; margin: -2px 0 8px; font-size: .78rem; color: var(--sp-muted); }
.spLatest b { color: var(--sp-head); font-weight: 600; }
.spMine { color: var(--sp-ink); font-weight: 600; }
/* A phrase ("Jordan paid", "your share $40") moves to the next line whole;
   one longer than the line wraps inside itself instead of running off it. */
.spNw { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }

/* ================= Buttons ================= */
.spBtn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 14px; width: auto;
  border-radius: 999px; border: 1px solid var(--ring);
  background: var(--card); color: var(--text);
  font-size: .86rem; font-weight: 650; line-height: 1; cursor: pointer; white-space: nowrap;
  box-shadow: none;
}
.spBtn:hover { border-color: var(--ring-strong); background: var(--card-soft); }
.spBtn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.spBtn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.spBtn--danger { color: var(--error); }
.spBtn--danger:hover { border-color: var(--error); background: var(--error-soft); }
.spBtn--sm { min-height: 36px; padding: 6px 12px; font-size: .8rem; }
.spBtn[disabled] { opacity: .5; cursor: default; }
.spBtn svg { width: 16px; height: 16px; }
.ct-paper .spBtn:not(.spBtn--primary) { background: var(--sp-surface); border-color: var(--sp-rule); color: var(--sp-head); }
.ct-paper .spBtn--primary { background: var(--sp-mark); border-color: var(--sp-mark); color: var(--look-box-check, var(--on-accent, #fff)); }

/* ================= Avatars ================= */
.spAv {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: .9rem; font-weight: 750; color: #fff; letter-spacing: 0;
  background: var(--accent);
}
.spAv.is-1 { background: color-mix(in srgb, var(--accent) 70%, #0e1f1a); }
.spAv.is-2 { background: color-mix(in srgb, var(--accent) 84%, #ffffff); }
.spAv.is-add { background: transparent; color: var(--sp-muted, var(--muted)); border: 1.5px dashed var(--ring-strong); font-size: 1.1rem; font-weight: 500; }
.spAv--sm { width: 30px; height: 30px; font-size: .78rem; }
.spAv--xs { width: 22px; height: 22px; font-size: .62rem; }
.spAv.is-me { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }

/* ================= Hero: identity + the personal line ================= */
.spWho { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.spWhoLabel { font-size: .82rem; font-weight: 700; margin-right: 2px; }
/* The hero is the card's rail (white ink on the rail tone on Classic, the
   look's ink on a look's ground), so everything on it is drawn from the
   hero's own ink, currentColor, and reads on both. */
.spWhoChip, .spMeSwitch {
  appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: 999px; width: auto; min-height: 0; line-height: 1;
  border: 1px solid color-mix(in srgb, currentColor 46%, transparent); background: transparent; color: inherit;
  font-size: .86rem; font-weight: 600; cursor: pointer; box-shadow: none;
}
/* Outlines, not tints: a tint lightens the rail under white type below 4.5:1. */
.spWhoChip:hover, .spMeSwitch:hover { border-color: currentColor; }
.spWhoChip .spAv, .spMeSwitch .spAv { box-shadow: none; background: #ffffff; color: var(--hero-rail, var(--accent)); }
.spWhoChip .spAv.is-add { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 60%, transparent); }
.ct-unfold.ct-paper .spWhoChip .spAv, .ct-unfold.ct-paper .spMeSwitch .spAv { background: var(--look-mark); color: var(--look-box-check); }
.ct-unfold.ct-paper .spWhoChip .spAv.is-add { background: transparent; color: inherit; }
.spMe { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-lg); background: transparent; border: 1px solid color-mix(in srgb, currentColor 34%, transparent); }
.spMeMain { min-width: 0; flex: 1 1 200px; }
.spMeLine { font-size: 1.15rem; font-weight: 780; letter-spacing: -.015em; line-height: 1.15; overflow-wrap: anywhere; }
.spMeSub { margin-top: 3px; font-size: .8rem; overflow-wrap: anywhere; }
.spMeSide { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.spMeSwitch { padding-right: 10px; font-size: .78rem; max-width: 100%; min-width: 0; }
.spMeSwitch > span:last-child, .spWhoChip > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spWhoChip { max-width: 100%; }
/* A big group: the "I'm…" chips scroll inside the hero instead of pushing
   the page down by a screen. */
.spWho { max-height: 232px; overflow-y: auto; overscroll-behavior: contain; }
.spHeroBtn {
  appearance: none; -webkit-appearance: none; width: auto; min-height: 0; padding: 9px 16px; border-radius: 999px; line-height: 1;
  border: 1px solid #ffffff; background: #ffffff; color: var(--hero-rail, var(--accent)); font-size: .86rem; font-weight: 750; cursor: pointer; box-shadow: var(--shadow-xs);
}
.spHeroBtn:hover { background: color-mix(in srgb, #ffffff 90%, var(--hero-rail, var(--accent))); }
.spHeroBtn--ghost { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 46%, transparent); }
.spHeroBtn--ghost:hover { border-color: currentColor; }
.ct-unfold.ct-paper .spHeroBtn:not(.spHeroBtn--ghost) { background: var(--look-pill-bg); border-color: var(--look-pill-bg); color: var(--look-pill-text); }

/* ================= Progress: money paid back so far ================= */
.spProg { margin: 2px 0 10px; }
.spProgHead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; font-size: .88rem; color: var(--sp-muted); }
.spProgText strong { color: var(--sp-head); font-weight: 780; font-size: 1.05rem; }
.spProgCount { font-weight: 650; color: var(--sp-ink); white-space: nowrap; }
.spProgBar { position: relative; height: 8px; margin-top: 8px; border-radius: 999px; background: var(--sp-track); overflow: hidden; }
.spProgFill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--sp-mark); transition: width .4s cubic-bezier(.22,1,.36,1); }

/* ================= Settle plan: who pays whom ================= */
.spPlan { list-style: none; margin: 0; padding: 0; }
.spPlanRow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "av who amt pay"; align-items: center; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--sp-rule); }
.spPlanRow:first-child { border-top: 0; }
.spPlanRow > .spAv { grid-area: av; }
.spPlanRow.is-mine { background: var(--sp-soft); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 12px; border-top-color: transparent; }
.spPlanRow.is-mine + .spPlanRow { border-top-color: transparent; }
.spPlanWho { grid-area: who; display: flex; flex-direction: column; min-width: 0; font-size: .95rem; color: var(--sp-muted); }
.spPlanWho b { color: var(--sp-head); font-weight: 680; overflow-wrap: anywhere; }
.spPlanWho small { margin-top: 2px; font-size: .76rem; color: var(--sp-muted); line-height: 1.35; }
.spPlanAmt { grid-area: amt; font-variant-numeric: tabular-nums; font-weight: 780; font-size: 1.02rem; white-space: nowrap; text-align: right; color: var(--sp-head); }
.spPlanPay { grid-area: pay; appearance: none; -webkit-appearance: none; width: auto; min-height: 36px; margin: 0; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--sp-mark); background: transparent; color: var(--sp-mark); font-size: .76rem; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: none; white-space: nowrap; }
.spPlanPay:hover { background: var(--sp-mark); color: var(--look-box-check, var(--on-accent, #fff)); }

/* ================= How it adds up: paid and share per person ================= */
.spWhy { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sp-rule); }
.spWhy > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: .84rem; font-weight: 650; color: var(--sp-muted); cursor: pointer; list-style: none; }
.spWhy > summary::-webkit-details-marker { display: none; }
.spWhy > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s ease; }
.spWhy[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.spWhy > summary:hover { color: var(--sp-head); }
.spBal { list-style: none; margin: 4px 0 0; padding: 0; }
/* The name and the verdict share the first line; "paid · share" runs the
   full width under them, so it stays on one line on a phone. */
.spBalRow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 1px 12px; padding: 7px 0; }
.spBalName { display: contents; }
.spBalWho { grid-column: 1; min-width: 0; font-size: .88rem; font-weight: 620; color: var(--sp-head); overflow-wrap: anywhere; }
.spBalName small { grid-column: 1 / -1; }
.spBalWho em { white-space: nowrap; font-style: normal; font-weight: 600; font-size: .72rem; color: var(--sp-ink); margin-left: 4px; }
.spBalName small { font-weight: 400; font-size: .76rem; color: var(--sp-muted); line-height: 1.35; overflow-wrap: anywhere; }
.spBalAmt { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; font-size: .86rem; font-weight: 650; white-space: nowrap; text-align: right; color: var(--sp-head); }
.is-owed .spBalAmt { color: var(--sp-ink); }
.is-zero .spBalAmt { color: var(--sp-muted); font-weight: 500; }

/* ================= Expenses ================= */
.spDay { margin: 12px 0 4px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: var(--sp-muted); }
.spDay:first-child { margin-top: 2px; }
.spExp, .spPay { list-style: none; margin: 0; padding: 0; }
.spExpRow, .spPayRow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 9px 6px; margin: 0 -6px; border-radius: 12px; cursor: pointer; }
.spExpRow:hover, .spPayRow:hover, .spExpRow:focus-visible, .spPayRow:focus-visible { background: var(--sp-soft); outline: none; }
.spExpRow[aria-disabled="true"], .spPayRow[aria-disabled="true"] { cursor: default; }
.spExpMain { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.spExpLabel { font-weight: 650; color: var(--sp-head); overflow-wrap: anywhere; line-height: 1.3; }
.spExpLabel .spExpItems { margin-left: 6px; vertical-align: 1px; }
.spExpItems { display: inline-block; font-size: .68rem; font-weight: 650; color: var(--sp-mark); background: var(--sp-track); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.spExpMeta { font-size: .76rem; color: var(--sp-muted); line-height: 1.4; overflow-wrap: anywhere; }
.spExpAmt, .spPayAmt { font-variant-numeric: tabular-nums; font-weight: 780; white-space: nowrap; color: var(--sp-head); line-height: 1.3; }
.spExpRow > .spAv, .spPayRow > .spAv { margin-top: 1px; }
.spPayWho { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .9rem; color: var(--sp-head); flex-wrap: wrap; }
.spPayWho b { font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
.spPayWho small { overflow-wrap: anywhere; }
.spPayWho small { flex-basis: 100%; font-size: .74rem; color: var(--sp-muted); }
.spPayRow { grid-template-columns: minmax(0, 1fr) auto; }

/* ================= People ================= */
.spPeople { display: flex; flex-wrap: wrap; gap: 8px; }
.spPerson { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 0; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--sp-rule); background: var(--sp-surface); color: var(--sp-head); font-size: .86rem; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: none; }
.spPerson:hover:not([disabled]) { border-color: var(--sp-mark); }
.spPerson[disabled] { cursor: default; opacity: 1; }
.spPerson.is-me { border-color: var(--sp-mark); background: var(--sp-soft); }
.spPerson small { font-weight: 500; color: var(--sp-muted); margin-left: 2px; }
.spPerson--add { border-style: dashed; color: var(--sp-muted); }

/* ================= Tools row ================= */
.spTools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ================= Bottom sheet (add / edit) ================= */
.spSheetBackdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(14,31,26,.42); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s ease; }
.spSheetBackdrop[hidden] { display: none; }
.spSheetBackdrop.is-open { opacity: 1; }
.spSheet { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto; box-sizing: border-box; background: var(--card); color: var(--text); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-elevated); transform: translateY(24px); transition: transform .22s cubic-bezier(.22,1,.36,1); }
.spSheetBackdrop.is-open .spSheet { transform: translateY(0); }
.spSheetHandle { display: block; width: 38px; height: 4px; border-radius: 999px; background: var(--ring-strong); margin: 4px auto 12px; }
.spSheet:focus { outline: none; }
.spSheetNote { display: block; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.spSheetHead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.spSheetTitle { margin: 0; font-size: 1.15rem; font-weight: 780; letter-spacing: -.01em; }
.spSheetSub { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.spForm { display: flex; flex-direction: column; gap: 12px; }
.spField { display: flex; flex-direction: column; gap: 5px; margin: 0; font-size: .82rem; font-weight: 650; color: var(--text); }
.spField input:not([type=checkbox]), .spField select, .spField textarea { font-size: 16px; padding: 10px 12px; font-weight: 400; width: 100%; }
.spField small { font-weight: 400; color: var(--muted); }
.spFieldRow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spAmount { position: relative; }
.spAmount .spCur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); pointer-events: none; }
.spAmount input { padding-left: 2.6em !important; font-size: 1.35rem !important; font-weight: 750; letter-spacing: -.01em; }
.spAmount input[readonly] { background: var(--card-soft); }
.spChips { display: flex; flex-wrap: wrap; gap: 6px; }
.spChip { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 6px; width: auto; min-height: 36px; max-width: 100%; padding: 4px 11px 4px 4px; border-radius: 999px; border: 1px solid var(--ring); background: var(--card); color: var(--text); font-size: .84rem; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: none; }
.spChip .spAv { width: 26px; height: 26px; font-size: .7rem; }
.spChip[aria-disabled="true"] { cursor: default; }
.spChip > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spChip[aria-pressed="true"], .spChip[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.spChip[aria-pressed="true"] .spAv { box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 3px var(--accent); }
.spSeg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card-soft); border: 1px solid var(--ring); }
.spSeg button { appearance: none; -webkit-appearance: none; flex: 1 1 0; width: auto; min-height: 36px; padding: 7px 4px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .8rem; font-weight: 650; line-height: 1; cursor: pointer; box-shadow: none; white-space: nowrap; }
.spSeg button[aria-pressed="true"] { background: var(--card); color: var(--accent); box-shadow: var(--shadow-xs); }
.spRows { display: flex; flex-direction: column; gap: 6px; }
.spRowLine { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px 0; }
.spRowLine .spRowName { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spRowLine .spRowVal { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.spRowLine input { width: 104px; text-align: right; font-size: 16px; padding: 8px 10px; }
.spStep { display: inline-flex; align-items: center; border: 1px solid var(--ring); border-radius: 999px; overflow: hidden; }
.spStep button { appearance: none; -webkit-appearance: none; width: 34px; min-height: 0; height: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--text); font-size: 1.05rem; font-weight: 600; cursor: pointer; box-shadow: none; }
.spStep output { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.spLive { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--card-soft); font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.spLive b { color: var(--text); }
.spLive.is-off { color: var(--error); background: var(--error-soft); }
.spItems { display: flex; flex-direction: column; gap: 8px; }
.spItem { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; gap: 6px; align-items: center; }
.spItem input { font-size: 16px; padding: 8px 10px; }
.spItemClaims { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 6px; border-bottom: 1px dashed var(--ring); }
.spItemClaims .spChip { min-height: 32px; padding: 3px 10px 3px 4px; font-size: .76rem; }
.spItemClaims .spChip .spAv { width: 20px; height: 20px; font-size: .58rem; }
.spItemDel { appearance: none; -webkit-appearance: none; width: 32px; min-height: 0; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--ring); background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; box-shadow: none; }
.spTipRow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spTipQuick { display: flex; gap: 4px; margin-top: 4px; }
.spTipQuick button { appearance: none; -webkit-appearance: none; width: auto; min-height: 32px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--ring); background: var(--card); color: var(--muted); font-size: .74rem; font-weight: 650; line-height: 1; cursor: pointer; box-shadow: none; }
.spTipQuick button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.spSheetActions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; position: sticky; bottom: 0; padding-top: 10px; background: linear-gradient(180deg, transparent, var(--card) 30%); pointer-events: none; }
.spSheetActions > * { pointer-events: auto; }
.spSheetActions .spBtn--danger { margin-left: auto; }
.spSheetActions .spBtn--primary { min-width: 120px; }
body.sp-sheet-open { overflow: hidden; }
@media (min-width: 641px) {
  .spSheetBackdrop { align-items: center; padding: 20px; }
  .spSheet { border-radius: var(--radius-xl); transform: translateY(12px) scale(.98); }
  .spSheetHandle { display: none; }
}

/* ================= Toast ================= */
.spToast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); opacity: 0; z-index: 1001; display: flex; align-items: center; gap: 14px; max-width: min(92vw, 440px); padding: 11px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: .86rem; box-shadow: var(--shadow-elevated); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.spToast.is-open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.spToast[hidden] { display: none; }
/* With a sheet open the toast sits at the top, clear of its buttons. */
body.sp-sheet-open .spToast { bottom: auto; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -12px); }
body.sp-sheet-open .spToast.is-open { transform: translate(-50%, 0); }
.spToastBtn { all: unset; cursor: pointer; font-weight: 750; color: var(--mark-b, #52c79c); padding: 2px 4px; }
.spToastBtn:focus-visible { outline: 2px solid var(--mark-b, #52c79c); border-radius: 4px; }

/* ================= Phone ================= */
@media (max-width: 480px) {
  .spSection { padding: 12px 12px 14px; border-radius: var(--radius-lg); }
  .spSection.ct-paper { padding-left: 22px; }
  .spMeLine { font-size: 1.05rem; }
  /* Phones: the amount with Mark paid under it on the right. */
  .spPlanRow { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av who amt" "av who pay"; align-items: start; row-gap: 6px; }
  .spPlanRow > .spAv { margin-top: -3px; }
  .spPlanPay { justify-self: end; }
  .spFieldRow { grid-template-columns: 1fr; }
  .spSeg button { font-size: .74rem; padding: 7px 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .spProgFill, .spSheet, .spSheetBackdrop, .spToast { transition: none; }
}

/* ================= Against ui.css's global button rules =================
   ui.css styles every button on non-home pages (a small radius at (0,3,2),
   an accent background on :hover and :active). These restate the split's
   own shapes above that specificity, and give every button its own hover. */
body:not(.ct-home) button:not(.theme-toggle):not(.ct-nav-toggle):is(.spBtn, .spChip, .spPlanPay, .spWhoChip, .spMeSwitch, .spHeroBtn, .spPerson) { border-radius: 999px; }
body:not(.ct-home) button:not(.theme-toggle):not(.ct-nav-toggle):is(.spSeg button, .spTipQuick button) { border-radius: 999px; }
body:not(.ct-home) button:not(.theme-toggle):not(.ct-nav-toggle).spItemDel { border-radius: 50%; }
body:not(.ct-home) button:not(.theme-toggle):not(.ct-nav-toggle):is(.spStep button) { border-radius: 0; }
body:not(.ct-home) button:not(.theme-toggle):not(.ct-nav-toggle).spHeroBtn { box-shadow: var(--shadow-xs); font-weight: 750; }
body:not(.ct-home) .spSeg button[aria-pressed="true"] { box-shadow: var(--shadow-xs); }
.spChip:hover, .spChip:active { background: var(--card-soft); }
.spChip[aria-pressed="true"]:hover, .spChip[aria-pressed="true"]:active { background: var(--accent-soft); }
.spChip[aria-disabled="true"]:hover { background: var(--card); }
.spChip[aria-disabled="true"][aria-pressed="true"]:hover { background: var(--accent-soft); }
.spSeg button:hover, .spSeg button:active { background: transparent; color: var(--text); }
.spSeg button[aria-pressed="true"]:hover, .spSeg button[aria-pressed="true"]:active { background: var(--card); color: var(--accent); }
.spStep button:hover, .spStep button:active { background: var(--card-soft); }
.spTipQuick button:hover, .spTipQuick button:active { background: var(--card-soft); }
.spTipQuick button[aria-pressed="true"]:hover { background: var(--accent-soft); }
.spItemDel:hover, .spItemDel:active { background: var(--card-soft); color: var(--text); }
.spPerson:hover, .spPerson:active { background: var(--sp-surface); }
.spPerson.is-me:hover, .spPerson.is-me:active { background: var(--sp-soft); }
.spPlanPay:active { background: var(--sp-mark); color: var(--look-box-check, var(--on-accent, #fff)); }
.spBtn:active { background: var(--card-soft); }
.spBtn--primary:active { background: var(--accent-hover); }
/* Touch screens keep :hover after a tap; there a chip looks the way it is. */
@media (hover: none) {
  .spChip:hover { background: var(--card); }
  .spChip[aria-pressed="true"]:hover { background: var(--accent-soft); }
  .spPlanPay:hover { background: transparent; color: var(--sp-mark); }
}

/* ================= Looks: contrast ================= */
/* Avatars on a paper take the paper's mark and its check colour, which the
   catalogue pairs for contrast (the accent itself washed out on Blueprint). */
.ct-paper .spAv { background: var(--sp-mark); color: var(--look-box-check, var(--on-accent, #fff)); }
.ct-paper .spAv.is-1 { background: color-mix(in srgb, var(--sp-mark) 78%, var(--sp-head)); }
.ct-paper .spAv.is-2 { background: color-mix(in srgb, var(--sp-mark) 86%, var(--sp-surface)); }
.ct-paper .spAv.is-add { background: transparent; color: var(--sp-muted); }
.ct-paper .spExpItems { color: var(--sp-head); }

/* Dark mode: primary labels read --on-accent (ui.css), dark on the mint. */

/* A very long name wraps inside its chip rather than widening the page. */
.spPerson { max-width: 100%; min-width: 0; text-align: left; line-height: 1.2; }
.spPerson > span:last-child { min-width: 0; overflow-wrap: anywhere; }

/* ================= Pressure-test fixes, round two ================= */
/* ui.css sets nowrap on buttons; an inline span ignores overflow, so the
   name spans inside chips are blocks that wrap or clip. */
.spPerson > span:last-child { display: block; white-space: normal; }
.spMeSwitch > span:last-child, .spWhoChip > span:last-child, .spChip > span:last-child { display: block; }
.spMeSide { flex: 0 1 auto; }
/* The item count reads at small size on the tinted pill. */
.spExpItems { color: color-mix(in srgb, var(--sp-mark) 72%, var(--sp-head)); }
/* ct-looks paints every <small> on a paper in the look's muted ink; the
   split's own muted (darkened on Sticky) wins inside its cards. */
.spSection.ct-paper small { color: var(--sp-muted); }
/* Room under the sheet's last field, so nothing sits under the action bar. */
.spSheet { scroll-padding-bottom: 88px; }
.spForm { padding-bottom: 4px; }
.spMore { margin-top: 8px; }
.spExpMore { margin-top: 10px; }
