/* ==========================================================================
   Spendt help centre (/help). Loaded after spendt.css, whose tokens, header,
   footer, buttons and card styles it reuses. Colours come only from the
   --ss-* tokens and the theme variables set in spendt.css. Sizes in rem.
   ========================================================================== */

/* ---------- In-app view (?from=app): no site header, footer or download buttons ---------- */
.inapp-bar { display: none; }
.in-app .site-header,
.in-app .site-footer,
.in-app [data-hide-in-app] { display: none; }
.in-app .inapp-bar {
  display: block;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.inapp-bar a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2.75rem;
  font-size: var(--ss-body-sm-size);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.inapp-bar svg { width: 1.125rem; height: 1.125rem; }
.in-app { scroll-padding-top: 3.5rem; }

/* ---------- Android / iPhone ---------- */
html[data-show="android"] .only-ios,
html[data-show="ios"] .only-android { display: none !important; }

/* Both showing (no choice yet, or no script): label each one */
html:not([data-show]) span.only-android::before,
html:not([data-show]) span.only-ios::before,
html:not([data-show]) p.only-android::before,
html:not([data-show]) p.only-ios::before,
html:not([data-show]) li.only-android::before,
html:not([data-show]) li.only-ios::before {
  display: inline-block;
  margin: 0 0.375rem 0 0.25rem;
  padding: 0 0.375rem;
  border-radius: 0.25rem;
  background: var(--tile);
  color: var(--text);
  font-size: var(--ss-micro-size);
  line-height: 1.25rem;
  font-weight: 700;
  vertical-align: 0.0625rem;
}
html:not([data-show]) .only-android::before { content: "Android"; }
html:not([data-show]) .only-ios::before { content: "iPhone"; }
html:not([data-show]) .player::before,
html:not([data-show]) .vcard__thumb > *::before { content: none !important; }

.platform-switch {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.platform-switch[hidden] { display: none; }
.platform-switch__label { font-size: var(--ss-body-sm-size); color: var(--muted); margin-right: 0.25rem; }
.platform-switch button {
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 62.4375rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--ss-body-sm-size);
  font-weight: 600;
  cursor: pointer;
}
.platform-switch button[aria-pressed="true"] {
  background: var(--ss-mint-green);
  border-color: var(--ss-mint-green);
  color: var(--ss-deep-navy);
}

/* ---------- Hero ---------- */
.help-hero { padding: 3rem 0 2.75rem; }
.help-hero h1 { margin-top: 0.5rem; }
.help-hero .lead { margin-top: 1rem; }
.help-hero__intro { max-width: 70ch; margin-top: 1rem; color: var(--muted); }
.help-hero__intro p + p { margin-top: 0.5rem; }
.help-hero__intro a { color: var(--text); }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: var(--ss-body-sm-size);
}
.crumbs li + li::before { content: "›"; margin-right: 0.5rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* ---------- Badges ---------- */
.applies {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.5rem;
  margin-top: 1rem;
}
.applies__label { font-size: var(--ss-body-sm-size); color: var(--muted); }
.applies ul { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }
.badge {
  display: inline-block;
  padding: 0.0625rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 62.4375rem;
  background: var(--surface);
  color: var(--text);
  font-size: var(--ss-micro-size);
  line-height: 1.375rem;
  font-weight: 600;
}
.badge--premium { border-color: var(--ss-mint-green); }

.tag--soon { margin: 0 0 0.25rem; border-color: var(--ss-mint-green); background: var(--tile); }

/* ---------- Layout ---------- */
.help-body { padding-top: 2.5rem; padding-bottom: 4rem; }
.help-body--narrow { max-width: 60rem; }
.help-body .legal__layout { grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: 2.5rem; }

/* Sections reuse the legal card; long help content doesn't lift on hover */
.article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 1.25rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--ss-radius-card);
  box-shadow: var(--shadow);
  scroll-margin-top: 5.5rem;
}
.article > * { grid-column: 2; }
.article > .legal__num { grid-column: 1; grid-row: 1; }
.article h2 { font-size: 1.375rem; line-height: 1.875rem; align-self: center; }
.article__body { min-width: 0; }
.article__body > * + * { margin-top: 1rem; }
.article__body > .applies:first-child { margin-top: 0.5rem; }
.article:target { border-color: var(--ss-mint-green); box-shadow: 0 0 0 2px var(--ss-mint-green); }

.steps { max-width: 70ch; }
.steps > * + * { margin-top: 0.75rem; }
.steps ol, .steps ul { margin: 0; padding-left: 1.375rem; }
.steps li { padding-left: 0.25rem; }
.steps li + li { margin-top: 0.5rem; }
.steps li > ul { margin-top: 0.5rem; }
.steps ol > li::marker { font-weight: 700; color: var(--text); }
.steps a, .faq__a a, .help-home a { color: var(--text); }
.steps code, .subject code {
  padding: 0.0625rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--tile);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
.note {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--ss-mint-green);
  border-radius: 0 var(--ss-radius-button) var(--ss-radius-button) 0;
  background: var(--tile);
}

.watch { font-size: var(--ss-body-sm-size); }
.watch a { color: var(--text); font-weight: 600; }

.inapp {
  display: grid;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--ss-radius-button);
  background: var(--bg);
}
.inapp__label {
  font-size: var(--ss-micro-size);
  line-height: var(--ss-micro-line);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.inapp .open-app { justify-self: start; min-height: 2.75rem; }
.inapp .open-app[hidden] { display: none; }

.message {
  margin: 0;
  padding: 0.875rem 1rem;
  border-left: 3px solid var(--ss-coral-alert);
  border-radius: 0 var(--ss-radius-button) var(--ss-radius-button) 0;
  background: var(--bg);
}
.message__label {
  font-size: var(--ss-micro-size);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.message p + p { margin-top: 0.25rem; font-weight: 600; }

.stuck { font-size: var(--ss-body-sm-size); }
.stuck a { color: var(--text); font-weight: 600; }
.checked { font-size: var(--ss-micro-size); color: var(--muted); }

/* ---------- Questions ---------- */
.related h3 { font-size: var(--ss-body-size); }
.related ul { margin: 0.5rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }

.faq {
  border: 1px solid var(--border);
  border-radius: var(--ss-radius-button);
  background: var(--surface);
  scroll-margin-top: 5.5rem;
}
.faq summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  position: relative;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--muted);
}
.faq[open] summary::after { content: "−"; }
.faq__q { margin: 0; font-size: var(--ss-body-size); line-height: var(--ss-body-line); font-weight: 600; }
.faq__a { padding: 0 1rem 1rem; color: var(--muted); }
.faq__a p + p { margin-top: 0.5rem; }
.faq__a b { color: var(--text); }
.faq__link { font-size: var(--ss-body-sm-size); }
.faq:target, .faq[open] { border-color: var(--ss-mint-green); }

.faq-group { display: grid; gap: 0.5rem; scroll-margin-top: 5.5rem; }
.faq-group h2 { font-size: 1.375rem; line-height: 1.875rem; }
.faq-group__more { margin-bottom: 0.5rem; font-size: var(--ss-body-sm-size); }
.faq-group__more a { color: var(--text); }
.faq-group + .faq-group { margin-top: 1.5rem; }
.faq-list { display: grid; gap: 0.5rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.compare { width: 100%; min-width: 0; border-collapse: collapse; font-size: var(--ss-body-sm-size); }
.compare th, .compare td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.compare thead th { font-weight: 700; }
.compare tbody th { font-weight: 400; color: var(--muted); }
.compare td { font-weight: 600; }

/* ---------- Video ---------- */
.video-block { display: grid; gap: 0.75rem; scroll-margin-top: 5.5rem; }
.video-block__title { font-size: 1.375rem; line-height: 1.875rem; }
.video-block__more { font-size: var(--ss-body-sm-size); color: var(--muted); }
.video-block__more a { color: var(--text); }
.players { display: grid; gap: 1rem; }
.player { margin: 0; }
.player video,
.player__soon {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--ss-radius-card);
  border: 1px solid var(--border);
  background: var(--ss-deep-navy);
}
.player video { object-fit: contain; }
.player__soon {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.5rem;
  color: var(--ss-cloud-white);
  font-weight: 600;
}
.player__soon svg {
  width: 2.5rem;
  height: 2.5rem;
  fill: none;
  stroke: var(--ss-mint-green);
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.player figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
  font-size: var(--ss-body-sm-size);
  color: var(--muted);
}
.player__plat {
  padding: 0 0.5rem;
  border-radius: 0.25rem;
  background: var(--tile);
  color: var(--text);
  font-size: var(--ss-micro-size);
  font-weight: 700;
}
html[data-show] .player__plat { display: none; }

.chapter { scroll-margin-top: 5.5rem; }
.chapter__summary { color: var(--muted); }
.chapter__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1rem; font-size: var(--ss-body-sm-size); font-weight: 600; }
.chapter__links a { color: var(--text); }
.playnext { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; font-size: var(--ss-body-sm-size); }
.playnext[hidden] { display: none; }
.playnext input { width: 1.125rem; height: 1.125rem; accent-color: var(--ss-mint-green); }

.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.pager a {
  display: grid;
  gap: 0.125rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--ss-radius-card);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.pager a:hover { border-color: var(--ss-mint-green); }
.pager small { font-size: var(--ss-micro-size); font-weight: 400; color: var(--muted); }
.pager__next { grid-column: 2; text-align: right; }

/* ---------- Home ---------- */
.help-home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; }
.home-block { min-width: 0; }
.home-block h2 { margin-bottom: 1rem; }
.home-block__more { margin-top: 1rem; font-size: var(--ss-body-sm-size); font-weight: 600; }

.search { margin-top: 1.5rem; max-width: 40rem; }
.search[hidden] { display: none; }
.search__label { display: block; margin-bottom: 0.5rem; font-size: var(--ss-body-sm-size); font-weight: 600; }
.search__box { position: relative; }
.search__box svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.search input {
  width: 100%;
  min-height: 3rem;
  padding: 0 1rem 0 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--ss-radius-button);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.search input:focus { outline: 2px solid var(--ss-mint-green); outline-offset: 1px; }
.search__results ul {
  display: grid;
  margin: 0.5rem 0 0;
  padding: 0.375rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--ss-radius-button);
  background: var(--surface);
}
.search__results a {
  display: grid;
  gap: 0.125rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  color: var(--text);
  text-decoration: none;
}
.search__results a:hover, .search__results a:focus { background: var(--tile); }
.search__title { font-weight: 600; }
.search__ctx { font-size: var(--ss-micro-size); color: var(--muted); }
.search__none { margin-top: 0.5rem; font-size: var(--ss-body-sm-size); color: var(--muted); }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tile {
  display: grid;
  gap: 0.25rem;
  height: 100%;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--ss-mint-green);
  border-radius: var(--ss-radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
}
.tile:hover { border-color: var(--ss-mint-green); }
.tile__title { font-weight: 700; }
.tile__text { font-size: var(--ss-body-sm-size); color: var(--muted); }

.vstrip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(12rem, 15rem);
  gap: 0.75rem;
  margin: 0;
  padding: 0 0 0.5rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.vstrip li { scroll-snap-align: start; }
.vcard { display: grid; gap: 0.5rem; color: var(--text); text-decoration: none; font-weight: 600; font-size: var(--ss-body-sm-size); }
.vcard__thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--ss-radius-button);
  background: var(--ss-deep-navy);
  color: var(--ss-cloud-white);
}
.vcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
html:not([data-show]) .vcard__thumb > .only-ios { display: none; }
.vcard__soon { font-size: var(--ss-micro-size); font-weight: 600; opacity: .85; padding-top: 2.5rem; }
.vcard__play {
  position: absolute;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.5rem;
  border-radius: 50%;
  background: var(--ss-mint-green);
  fill: var(--ss-deep-navy);
}
.vcard:hover .vcard__thumb { outline: 2px solid var(--ss-mint-green); }

.home-contact { padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--ss-radius-card); background: var(--surface); }
.selectable { user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }

/* ---------- Contact ---------- */
.copy-field { padding: 1rem; border: 1px solid var(--border); border-radius: var(--ss-radius-button); background: var(--bg); }
.copy-field__label { font-size: var(--ss-micro-size); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.copy-field__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.25rem; }
.copy-field__value {
  font-size: 1.125rem;
  font-weight: 700;
  user-select: all;
  -webkit-user-select: all;
  overflow-wrap: anywhere;
}
.copy-field__note { margin-top: 0.5rem; font-size: var(--ss-body-sm-size); color: var(--muted); }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  padding: 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--ss-radius-button);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--ss-body-sm-size);
  font-weight: 600;
  cursor: pointer;
}
.copy-btn[hidden] { display: none; }
.copy-btn:hover { border-color: var(--ss-mint-green); }
.copy-btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.subject { font-weight: 600; }
.provider-list li + li { margin-top: 0.5rem; }

/* ---------- Narrow screens ---------- */
@media (max-width: 800px) {
  .help-hero { padding: 2rem 0; }
  .help-body { padding-top: 1.5rem; padding-bottom: 3rem; }
  .help-body .legal__layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .article { grid-template-columns: minmax(0, 1fr); padding: 1.25rem; }
  .article > *, .article > .legal__num { grid-column: 1; }
  .article > .legal__num { width: 2.25rem; height: 2.25rem; font-size: var(--ss-body-sm-size); }
  .article h2 { grid-row: 2; margin-top: 0.5rem; }
  /* The contents list is long on a phone: keep it, but compact */
  .help-body .legal__toc { padding: 1rem; }
  .help-body .legal__toc ol { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
  .site-nav { gap: 1.25rem; }
  .platform-switch__label { flex-basis: 100%; }
  .platform-switch button { padding: 0 0.875rem; }
}

@media (max-width: 520px) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager__next { grid-column: 1; }
}
