/* Splitit split widget in a bank's transaction screen (docs/embedded/WIDGET.md).
   Everything the bank owns comes from the --host-* tokens (docs/embedded/SPEC.md):
   surface, ink, lines, radii, type, the CTA. The one Splitit brand signal is its
   own logo. Colour, opacity and border transitions only, off under reduced motion.
   Classes are prefixed ssw- so nothing here reaches the bank's page. */

.ssw {
  --ssw-fill: var(--host-primary, #2B4C7E);           /* paid segments, selection */
  --ssw-ring: var(--host-link, #2B5FA8);
  --ssw-track: color-mix(in srgb, var(--host-ink, #1A1F26) 9%, transparent);
  --ssw-soft: var(--host-soft, color-mix(in srgb, var(--host-link, #2B5FA8) 10%, transparent));
  display: block; color: var(--host-ink, #1A1F26);
  font-family: var(--host-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  -webkit-font-smoothing: antialiased;
}
.ssw[hidden] { display: none; }
/* Dark: the brand colour is usually a deep band tone; the lighter link tone reads on the surface. */
html[data-theme="dark"] .ssw, html[data-theme="dark"] .ssw-layer { --ssw-fill: var(--host-link, #8FA8D0); }
.ssw *, .ssw-layer * { box-sizing: border-box; }
.ssw-num { font-variant-numeric: tabular-nums lining-nums; }
/* After any font: shorthand (which resets it): figures stay tabular and lining. */
.ssw .ssw-num, .ssw-layer .ssw-num { font-variant-numeric: tabular-nums lining-nums; }
.ssw-nw { white-space: nowrap; }
.ssw-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The Splitit logo: the real artwork, by theme (dark ink on light, white on dark). */
.ssw-logo { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.ssw-logo img { display: block; height: 100%; width: auto; }
.ssw-logo .ssw-logo-d { display: none; }
html[data-theme="dark"] .ssw-logo .ssw-logo-l { display: none; }
html[data-theme="dark"] .ssw-logo .ssw-logo-d { display: block; }
.ssw-logo-xs { height: 14px; }
.ssw-logo-sm { height: 18px; }
.ssw-logo-md { height: 20px; }

.ssw-ic { width: 20px; height: 20px; flex: none; }
.ssw-lbl {
  font-size: 12px; font-weight: 600; color: var(--host-muted, #5A6472);
  text-transform: var(--host-label-case, none);
}
html[data-host-label="uppercase"] .ssw-lbl { letter-spacing: .06em; font-size: 11px; font-weight: 700; }
/* A legend is read as a sentence: sentence case in every bank, whatever --host-label-case. */
.ssw-legend {
  margin: 0; font: 600 15px/1.3 var(--host-font-body, inherit); letter-spacing: 0;
  text-transform: none; color: var(--host-ink, #1A1F26);
}

/* ── Card shell (the bank's card) ─────────────────────────────── */
.ssw-card {
  background: var(--host-surface, #FFFFFF); color: var(--host-ink, #1A1F26);
  border: 1px solid var(--host-line, rgba(26, 31, 38, .12));
  border-radius: var(--host-radius-card, 12px); overflow: hidden;
}

/* ── 1. Offer ─────────────────────────────────────────────────── */
.ssw-offer-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 88px;
  padding: 16px; border: 0; background: transparent; color: inherit; font: inherit;
  text-align: left; cursor: pointer;
  transition: background-color 150ms ease;
}
.ssw-offer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ssw-offer-main .ssw-logo { margin-bottom: 4px; }
.ssw-offer-title { font: 600 16px/1.3 var(--host-font-display, inherit); }
.ssw-offer-sub { font-size: 13px; line-height: 1.4; color: var(--host-muted, #5A6472); text-wrap: balance; }
.ssw-offer-sub b { font-weight: 600; color: var(--host-ink, #1A1F26); }
.ssw-chev { color: var(--host-link, #2B5FA8); }
@media (hover: hover) and (pointer: fine) { .ssw-offer-btn:hover { background: var(--ssw-soft); } }
.ssw-offer-btn:active { background: var(--ssw-soft); }

.ssw-quiet { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 4px 2px; font-size: 13px; color: var(--host-muted, #5A6472); }
.ssw-quiet .ssw-logo { opacity: .75; }
.ssw-note { margin: 10px 2px 0; font-size: 13px; line-height: 1.4; color: var(--host-muted, #5A6472); }
/* "Split undone": an inline confirmation in the bank's soft tint, with a check. */
.ssw-note-done {
  display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding: 12px 14px;
  border-radius: var(--host-radius-card, 12px); background: var(--ssw-soft);
  border: 1px solid color-mix(in srgb, var(--host-link, #2B5FA8) 35%, transparent);
  font-size: 14px; font-weight: 600; color: var(--host-ink, #1A1F26);
}
.ssw-note-done .ssw-ic { width: 18px; height: 18px; margin-top: 1px; color: var(--host-link, #2B5FA8); stroke-width: 2.25; }

/* ── Focus (bank link colour, 2px, offset 2) ──────────────────── */
.ssw :focus-visible, .ssw-layer :focus-visible { outline: 2px solid var(--host-link, #2B5FA8); outline-offset: 2px; }
.ssw-offer-btn:focus-visible { outline-offset: -3px; border-radius: var(--host-radius-card, 12px); }
.ssw [tabindex="-1"]:focus, .ssw-layer [tabindex="-1"]:focus { outline: none; }

/* ── 4. Plan detail ───────────────────────────────────────────── */
.ssw-plan { padding: 16px; }
.ssw-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; }
.ssw-badge {
  font-size: 12px; font-weight: 600; padding: 4px 10px; white-space: nowrap;
  border-radius: var(--host-radius-chip, var(--host-radius-btn, 999px));
  background: var(--ssw-soft); color: var(--host-ink, #1A1F26); font-variant-numeric: tabular-nums;
}
.ssw-plan-title { margin: 12px 0 2px; font: 600 18px/1.3 var(--host-font-display, inherit); }
.ssw-plan-sub { margin: 0; font-size: 13px; color: var(--host-muted, #5A6472); }
/* Labels on one row, figures on the next, sharing a baseline. */
.ssw-plan-fig { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: baseline; margin-top: 16px; }
.ssw-plan-fig .ssw-end { text-align: right; justify-self: end; }
/* Money in the bank's body face, never the display face (a serif's old-style figures). */
.ssw-big { font: var(--host-money-weight, 600) 28px/1.15 var(--host-font-body, inherit); letter-spacing: -0.01em; font-variant-numeric: tabular-nums lining-nums; }
.ssw-mid { font: 600 16px/1.15 var(--host-font-body, inherit); font-variant-numeric: tabular-nums lining-nums; }

.ssw-track { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 14px 0 4px; }
.ssw-seg { height: 8px; border-radius: 999px; background: var(--ssw-track); }
.ssw-seg.is-paid { background: var(--ssw-fill); }
.ssw-seg.is-current { box-shadow: inset 0 0 0 2px var(--ssw-fill); }
/* Scheduled, not disabled: a clear 1px outline over a light hatch. */
.ssw-seg.is-left { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--ssw-fill) 16%, transparent) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ssw-fill) 55%, transparent); }

.ssw-dl { margin: 12px 0 0; padding: 0; }
.ssw-dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--host-line, rgba(26, 31, 38, .12)); }
.ssw-dl > div:first-child { border-top: 0; }
.ssw-dl dt { font-size: 14px; color: var(--host-muted, #5A6472); flex: none; }
.ssw-dl dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; min-width: 0; }
.ssw-dd-sub { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--host-muted, #5A6472); }
.ssw-dl .is-total dt, .ssw-dl .is-total dd { color: var(--host-ink, #1A1F26); font-weight: 700; }

.ssw-sched { margin-top: 4px; border-top: 1px solid var(--host-line, rgba(26, 31, 38, .12)); }
.ssw-sched > summary {
  display: flex; align-items: center; gap: 8px; min-height: 48px; cursor: pointer; list-style: none;
}
.ssw-sched > summary::-webkit-details-marker { display: none; }
.ssw-sched-count { margin-left: auto; font-size: 13px; color: var(--host-muted, #5A6472); white-space: nowrap; }
.ssw-sched > summary .ssw-legend { white-space: nowrap; }
.ssw-disc { width: 18px; height: 18px; color: var(--host-muted, #5A6472); transform: rotate(90deg); }
.ssw-sched[open] .ssw-disc { transform: rotate(-90deg); }
.ssw-sched-list { list-style: none; margin: 0 0 4px; padding: 0; }
.ssw-sched-row { display: flex; align-items: center; gap: 12px; min-height: 40px; font-size: 14px; border-top: 1px solid var(--host-line, rgba(26, 31, 38, .12)); }
.ssw-sched-row:first-child { border-top: 0; }
.ssw-sched-i {
  width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--host-muted, #5A6472); background: var(--ssw-track); font-variant-numeric: tabular-nums;
}
.ssw-sched-row.is-next .ssw-sched-i { background: transparent; box-shadow: inset 0 0 0 2px var(--ssw-fill); color: var(--host-ink, #1A1F26); }
.ssw-sched-row.is-paid .ssw-sched-i { background: var(--ssw-fill); color: var(--host-surface, #FFFFFF); }
.ssw-sched-row.is-paid { color: var(--host-muted, #5A6472); }
.ssw-sched-date { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ssw-sched-row b { font-weight: 600; }
.ssw-tag {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--host-radius-chip, var(--host-radius-btn, 999px));
  text-transform: var(--host-label-case, none);
}
.ssw-tag.is-next { background: var(--ssw-soft); color: var(--host-link, #2B5FA8); }
.ssw-tag.is-paid { background: var(--ssw-track); color: var(--host-muted, #5A6472); }
.ssw-sched-note { font-size: 12px; color: var(--host-muted, #5A6472); }

.ssw-plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ssw-undo { margin-top: 8px; }
.ssw-undo [hidden] { display: none; }
.ssw-confirm { margin-top: 4px; padding: 14px; border-radius: var(--host-radius-card, 12px); border: 1px solid var(--host-line, rgba(26, 31, 38, .12)); background: color-mix(in srgb, var(--host-ink, #1A1F26) 3%, var(--host-surface, #FFFFFF)); }
.ssw-confirm-q { margin: 0; font: 600 15px/1.3 var(--host-font-body, inherit); }
.ssw-confirm .ssw-cap { margin-top: 4px; font-size: 13px; }
.ssw-confirm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ssw-confirm-acts .ssw-btn { flex: 1 1 140px; }
.ssw-cap { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--host-muted, #5A6472); }

/* ── Buttons ──────────────────────────────────────────────────── */
.ssw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px; border-radius: var(--host-radius-btn, 10px);
  font: 600 15px/1.2 var(--host-font-body, inherit); text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; background: transparent; color: inherit;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.ssw-btn .ssw-ic { width: 18px; height: 18px; }
.ssw-btn-cta { width: 100%; min-height: 52px; background: var(--host-cta, #2B4C7E); color: var(--host-cta-ink, #FFFFFF); font-size: 16px; border: 1px solid var(--host-cta-line, transparent); }
.ssw-btn-fill { background: var(--host-cta, #2B4C7E); color: var(--host-cta-ink, #FFFFFF); border: 1px solid var(--host-cta-line, transparent); }
@media (hover: hover) and (pointer: fine) { .ssw-btn-fill:hover { background: color-mix(in srgb, var(--host-cta, #2B4C7E) 88%, #000); } }
@media (hover: hover) and (pointer: fine) { .ssw-btn-cta:hover { background: color-mix(in srgb, var(--host-cta, #2B4C7E) 88%, #000); } }
.ssw-btn-line { border-color: var(--host-link, #2B5FA8); color: var(--host-link, #2B5FA8); flex: 1 1 auto; }
.ssw-plan-actions .ssw-btn-line { width: 100%; justify-content: space-between; }
.ssw-btn-quiet { color: var(--host-link, #2B5FA8); padding: 0 4px; margin-left: -4px; }
@media (hover: hover) and (pointer: fine) { .ssw-btn-line:hover, .ssw-btn-quiet:hover { background: var(--ssw-soft); } }

/* ── 2–3. The sheet ───────────────────────────────────────────── */
html.ssw-lock, html.ssw-lock body { overflow: hidden; }
.ssw-layer {
  --ssw-fill: var(--host-primary, #2B4C7E);
  --ssw-track: color-mix(in srgb, var(--host-ink, #1A1F26) 9%, transparent);
  --ssw-soft: var(--host-soft, color-mix(in srgb, var(--host-link, #2B5FA8) 10%, transparent));
  position: fixed; inset: 0; z-index: 1000;
  color: var(--host-ink, #1A1F26);
  font-family: var(--host-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  -webkit-font-smoothing: antialiased;
}
.ssw-scrim { position: absolute; inset: 0; background: rgba(8, 12, 18, .48); opacity: 0; transition: opacity 180ms ease; }
html[data-theme="dark"] .ssw-scrim { background: rgba(0, 0, 0, .62); }
.ssw-panel {
  position: fixed; display: flex; flex-direction: column; overflow: hidden;
  background: var(--host-surface, #FFFFFF); color: var(--host-ink, #1A1F26);
  border: 1px solid var(--host-line, rgba(26, 31, 38, .12));
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  opacity: 0; transition: opacity 180ms ease;
}
.ssw-layer.is-open .ssw-scrim, .ssw-layer.is-open .ssw-panel { opacity: 1; }
.ssw-layer[data-as="sheet"] .ssw-panel {
  bottom: 0; border-bottom: 0;
  border-radius: max(12px, var(--host-radius-card, 12px)) max(12px, var(--host-radius-card, 12px)) 0 0;
}
.ssw-layer[data-as="sheet"] .ssw-panel::before {
  content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
  border-radius: 999px; background: var(--host-line, rgba(26, 31, 38, .2));
}
.ssw-layer[data-as="dialog"] .ssw-panel { border-radius: max(12px, var(--host-radius-card, 12px)); }

.ssw-sh-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 0; flex: none; }
.ssw-sh-brand { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.ssw-sh-head { padding-top: 16px; }
.ssw-sh-powered { font-size: 12px; color: var(--host-muted, #5A6472); line-height: 1.3; text-wrap: balance; }
.ssw-icbtn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--host-ink, #1A1F26); cursor: pointer;
  transition: background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .ssw-icbtn:hover { background: var(--ssw-soft); } }
.ssw-icgap { width: 44px; flex: none; }
.ssw-sh-title { margin: 12px 20px 0; font: 600 22px/1.25 var(--host-font-display, inherit); flex: none; }
.ssw-sh-sub { margin: 4px 0 0; font-size: 14px; line-height: 1.4; color: var(--host-muted, #5A6472); }
.ssw-sh-sub b { color: var(--host-ink, #1A1F26); font-weight: 600; }
.ssw-sh-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 20px 16px; overscroll-behavior: contain; }
.ssw-sh-foot { flex: none; padding: 12px 20px calc(16px + var(--ssw-pad-b, 0px)); border-top: 1px solid var(--host-line, rgba(26, 31, 38, .12)); background: var(--host-surface, #FFFFFF); }
.ssw-sec { display: block; margin: 20px 0 8px; }
.ssw-legend.ssw-sec { margin: 20px 0 10px; }
/* While more of the body is below: a fading edge over the pinned footer (DESIGN.md → Tabletop). */
.ssw-panel[data-more] .ssw-sh-body { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
/* Tabletop: the content above the crease, the action row below it. */
.ssw-layer[data-halves] .ssw-sh-foot { min-height: var(--ssw-foot-h); padding-top: calc(var(--ssw-crease, 0px) + 16px); border-top: 0; }
.ssw-layer[data-halves] .ssw-panel[data-step="done"] .ssw-done { justify-content: flex-end; }

.ssw-opts { display: flex; flex-direction: column; gap: 8px; }
.ssw-opt {
  display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--host-line, rgba(26, 31, 38, .12)); border-radius: var(--host-radius-card, 12px);
  background: var(--host-surface, #FFFFFF);
  transition: border-color 150ms ease, background-color 150ms ease;
}
.ssw-opt.is-on { border-color: var(--host-link, #2B5FA8); box-shadow: inset 0 0 0 1px var(--host-link, #2B5FA8); background: var(--ssw-soft); }
.ssw-radio { width: 20px; height: 20px; flex: none; border-radius: 999px; border: 2px solid var(--host-muted, #5A6472); transition: border-color 150ms ease; }
.ssw-opt.is-on .ssw-radio { border: 6px solid var(--host-link, #2B5FA8); }
.ssw-opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ssw-opt-n { font-size: 15px; font-weight: 600; }
.ssw-opt-sub { font-size: 12px; line-height: 1.4; color: var(--host-muted, #5A6472); }
.ssw-opt-sub b { color: var(--host-ink, #1A1F26); font-weight: 600; }
.ssw-opt-per { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.ssw-opt-per b { font-size: 18px; font-weight: 700; }
.ssw-opt-per span { font-size: 12px; color: var(--host-muted, #5A6472); }
.ssw-opt:focus-visible { outline: 2px solid var(--host-link, #2B5FA8); outline-offset: 2px; }
.ssw-note-s { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--host-muted, #5A6472); }

.ssw-terms { margin-top: 12px; }
.ssw-points { margin: 0; padding: 0 0 0 18px; font-size: 13px; line-height: 1.5; color: var(--host-ink, #1A1F26); }
.ssw-points li + li { margin-top: 8px; }
.ssw-points .ssw-ph { color: var(--host-muted, #5A6472); font-style: italic; }
.ssw-legal { margin: 16px 0 0; }
.ssw-legal a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--host-link, #2B5FA8); text-decoration: none; }
.ssw-legal a .ssw-ic { width: 16px; height: 16px; }
.ssw-agree-cap { text-align: center; }

.ssw-done { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 20px 24px; }
.ssw-done .ssw-sh-title { margin: 14px 0 0; }
.ssw-done-ic { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 999px; background: var(--ssw-fill); color: var(--host-surface, #FFFFFF); }
.ssw-done-ic .ssw-ic { width: 28px; height: 28px; stroke-width: 2.25; }
.ssw-panel[data-step="done"] .ssw-btn-cta { width: 100%; }

/* Tabletop and other short sheets: the scroller takes what is left. */
@media (max-height: 520px) { .ssw-sh-title { margin-top: 6px; font-size: 19px; } .ssw-opt { min-height: 60px; padding: 8px 12px; } }

@media (prefers-reduced-motion: reduce) {
  .ssw *, .ssw-layer, .ssw-layer * { transition: none !important; }
}
@media (forced-colors: active) {
  .ssw-seg.is-paid, .ssw-done-ic { background: CanvasText; }
  .ssw-opt.is-on { outline: 2px solid Highlight; }
}

/* ── Minimal integration: the bank's one row on a purchase ─────────
   Drawn like the bank's own rows (its card, ink, link colour); no Splitit
   mark. Tapping it opens the Splitit sheet, where everything else lives. */
.ssw-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px;
  padding: 14px 16px; border: 1px solid var(--host-line, rgba(26, 31, 38, .12));
  border-radius: var(--host-radius-card, 12px); background: var(--host-surface, #FFFFFF);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background-color 150ms ease;
}
.ssw-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ssw-row-title { font: 600 15px/1.3 var(--host-font-body, inherit); color: var(--host-link, #2B5FA8); }
.ssw-row.is-plan .ssw-row-title { color: var(--host-ink, #1A1F26); }
.ssw-row-sub { font-size: 13px; line-height: 1.35; color: var(--host-muted, #5A6472); }
.ssw-row-sub b { font-weight: 600; color: var(--host-ink, #1A1F26); }
.ssw-row .ssw-track { margin: 10px 0 0; }
.ssw-row .ssw-seg { height: 6px; }
.ssw-row .ssw-seg.is-current { box-shadow: inset 0 0 0 1.5px var(--ssw-fill); }
@media (hover: hover) and (pointer: fine) { .ssw-row:hover, .ssw-prow:hover { background: var(--ssw-soft); } }
.ssw-row:active, .ssw-prow:active { background: var(--ssw-soft); }
.ssw-row:focus-visible, .ssw-prow:focus-visible { outline: 2px solid var(--host-link, #2B5FA8); outline-offset: 2px; }

/* ── The sheet's plan list (from the bank's Splitit account row) ──── */
.ssw-sum { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 24px; }
.ssw-sum .ssw-sh-sub { margin: 0; }
.ssw-plist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--host-line, rgba(26, 31, 38, .12)); }
.ssw-plist li { border-bottom: 1px solid var(--host-line, rgba(26, 31, 38, .12)); }
.ssw-prow {
  display: flex; align-items: center; gap: 12px; width: calc(100% + 16px); min-height: 68px;
  margin: 0 -8px; padding: 12px 8px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background-color 150ms ease;
}
.ssw-prow .ssw-row-title { color: var(--host-ink, #1A1F26); }
.ssw-prow .host-mono { flex: none; }
.ssw-prow-amt { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--host-muted, #5A6472); white-space: nowrap; }
.ssw-prow-amt b { font-size: 15px; font-weight: 600; color: var(--host-ink, #1A1F26); }
.ssw-plist + .ssw-note-s { margin-top: 16px; }
/* Undo: the icon's drawn edge lines up with the sheet's content edge. */
.ssw-layer .ssw-undo .ssw-btn-quiet { margin-left: -7px; }

/* ── Merchant mark in the sheet ─────────────────────────────────── */
.ssw-merch { display: inline-flex; flex: none; line-height: 0; }
.ssw-merch .host-mono { width: 24px; height: 24px; margin: 0; font-size: 11px; }
.ssw-sh-sub.has-merch { display: flex; align-items: center; gap: 8px; }
.ssw-sh-sub.has-merch > span:last-child { min-width: 0; }

/* ── Split confirmed: the purchase's mark rises, a check draws itself,
   the plan's bar fills in, one segment after another. One easing, no overshoot. */
.ssw-layer { --ssw-ease: cubic-bezier(0.22, 1, 0.36, 1); }
.ssw-done-mark { position: relative; display: inline-flex; animation: sswRise 320ms var(--ssw-ease) both; }
.ssw-done-mark .ssw-merch .host-mono { width: 64px; height: 64px; font-size: 24px; }
.ssw-done-badge {
  position: absolute; right: -6px; bottom: -4px; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--ssw-fill); color: var(--host-surface, #FFFFFF);
  box-shadow: 0 0 0 3px var(--host-surface, #FFFFFF);
  animation: sswBadge 240ms var(--ssw-ease) 160ms both;
}
.ssw-done-badge .ssw-ic { width: 16px; height: 16px; stroke-width: 2.75; }
.ssw-done-check { stroke-dasharray: 24; stroke-dashoffset: 24; animation: sswDraw 340ms var(--ssw-ease) 300ms forwards; }
.ssw-done.is-split .ssw-sh-title { margin-top: 16px; animation: sswRise 320ms var(--ssw-ease) 120ms both; }
.ssw-done.is-split .ssw-sh-sub { animation: sswRise 320ms var(--ssw-ease) 180ms both; }
.ssw-done-track { width: 100%; max-width: 320px; margin-top: 20px; animation: sswRise 320ms var(--ssw-ease) 240ms both; }
.ssw-done-track .ssw-track { margin: 0; }
.ssw-done-track .ssw-seg, .ssw-row.is-fresh .ssw-seg { transform-origin: left center; animation: sswGrow 320ms var(--ssw-ease) both; }
.ssw-done-legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--host-muted, #5A6472); font-variant-numeric: tabular-nums; }
.ssw-row.is-fresh { animation: sswRise 320ms var(--ssw-ease) both; }
.ssw-row { --ssw-ease: cubic-bezier(0.22, 1, 0.36, 1); }

/* Each step's content settles in as the sheet moves on (choose → terms → done, list → plan). */
.ssw-panel .ssw-sh-title, .ssw-panel .ssw-sh-body { animation: sswStep 220ms var(--ssw-ease) both; }
.ssw-done.is-split .ssw-sh-title { animation-duration: 320ms; }

@keyframes sswRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sswStep { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes sswBadge { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes sswDraw { to { stroke-dashoffset: 0; } }
@keyframes sswGrow { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .ssw-done-mark, .ssw-done-badge, .ssw-done-track, .ssw-done.is-split .ssw-sh-title, .ssw-done.is-split .ssw-sh-sub,
  .ssw-done-track .ssw-seg, .ssw-row.is-fresh, .ssw-row.is-fresh .ssw-seg,
  .ssw-panel .ssw-sh-title, .ssw-panel .ssw-sh-body { animation: none; }
  .ssw-done-check { animation: none; stroke-dashoffset: 0; }
}

/* ── Sheet edges (polish, Nov 15): one 24px content edge; the top bar and the
   action row keep clear of the sheet's edges and the device's bottom inset. ── */
.ssw-layer[data-as="sheet"] .ssw-panel::before { top: 8px; }
.ssw-sh-head { padding: 24px 12px 0; }
.ssw-layer[data-as="dialog"] .ssw-sh-head { padding-top: 16px; }
.ssw-sh-title { margin: 16px 24px 0; }
.ssw-sh-body { padding: 0 24px 24px; }
.ssw-sh-foot { padding: 16px 24px calc(24px + max(var(--ssw-pad-b, 0px), env(safe-area-inset-bottom, 0px))); }
.ssw-done { padding: 24px 24px 24px; }
.ssw-done .ssw-sh-title, .ssw-done.is-split .ssw-sh-title { margin-left: 0; margin-right: 0; }
.ssw-layer[data-halves] .ssw-sh-foot { padding-left: 24px; padding-right: 24px; }
