/* Help pages (/help/*, layout: site/_includes/layouts/help.njk).
   Colors are the mystro-rn design tokens (components/design.ts), light and
   dark; type sizes and weights are MText's (10/13/16/20/24/32, 400/500/600);
   cards, buttons and chips copy Card.tsx, Button.tsx and Chip.ts. The font is
   the app's: Avenir Next on Apple devices, Roboto/system on Android. */

:root {
  color-scheme: light;
  --label-primary: #000000;
  --label-secondary: #50505B;
  --label-tertiary: #BFBFC6;
  --label-inverted: #FFFFFF;
  --stroke: #BFBFC6;
  --bg-primary: #FFFFFF;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F2F2F7;
  --bg-inverted: #000000;
  --bg-highlight: #FFDCD2;
  --brand-primary: #F23900;
  --brand-accent: #F23900;
  --fill-secondary: #7878781e;
  --fill-brand: #FFE7E0;
  --card-shadow: 0 0 32px #00000014;
}

/* Dark: the app's dark tokens, by system setting unless ?theme=light, or forced by ?theme=dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --label-primary: #FFFFFF;
    --label-secondary: #ECECF4;
    --label-tertiary: #868686;
    --label-inverted: #000000;
    --stroke: #868686;
    --bg-primary: #000000;
    --bg-secondary: #202020;
    --bg-tertiary: #000000;
    --bg-inverted: #FFFFFF;
    --bg-highlight: #5C5C5C;
    --brand-accent: #FFFFFF;
    --fill-secondary: #7676803d;
    --fill-brand: #611700;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --label-primary: #FFFFFF;
  --label-secondary: #ECECF4;
  --label-tertiary: #868686;
  --label-inverted: #000000;
  --stroke: #868686;
  --bg-primary: #000000;
  --bg-secondary: #202020;
  --bg-tertiary: #000000;
  --bg-inverted: #FFFFFF;
  --bg-highlight: #5C5C5C;
  --brand-accent: #FFFFFF;
  --fill-secondary: #7676803d;
  --fill-brand: #611700;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--label-primary);
  font-family: "Avenir Next", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--brand-primary); }

/* Chrome. Hidden in the app's webview (?source=mystro_app). */
.help-header,
.help,
.help-footer {
  max-width: 600px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.help-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 12px;
  padding-bottom: 12px;
}
/* Hairline under the header, like the one above the footer. The header stays
   on screen (the menu button with it), and the phone menu drops down under it. */
:root { --header-h: 65px; }
.help-header { position: sticky; z-index: 30; top: 0; margin-bottom: 8px; border-bottom: 1px solid var(--fill-secondary); background: var(--bg-primary); }
.help-header .help-lockup { margin-inline-end: auto; }
.help-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-inline-end: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--label-primary);
  cursor: pointer;
}
.help-menu-btn .help-icon-glyph { width: 24px; height: 24px; }
/* The app's orange logo with "Help" in the regular text color. */
.help-lockup { display: flex; align-items: center; gap: 8px; color: var(--label-primary); text-decoration: none; }
.help-lockup .help-logo { flex: none; }
.help-lockup span { font-size: 20px; font-weight: 600; line-height: 1; }
.help-footer {
  margin-top: 40px;
  padding-top: 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--fill-secondary);
  color: var(--label-secondary);
  font-size: 13px;
}
.help-footer p { margin: 0 0 8px; }
.help-footer-legal, .help-footer-legal a { color: var(--label-tertiary); }
[data-i18n-pending] body { visibility: hidden; }
[data-app] .help-header,
[data-app] .help-footer,
[data-app] .help-drawer,
[data-app] .help-backdrop { display: none; }
[data-app] .help { padding-top: 8px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }

/* Button.tsx: radius 8, 10/12 padding, brand fill. Small: 4/8, 13px. */
.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--brand-primary);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.help-btn-small { padding: 4px 8px; font-size: 13px; }

/* Type. */
.help-eyebrow {
  margin: 16px 0 4px;
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.help h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
}
.help h2 {
  margin: 32px 0 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.help h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.help p { margin: 0; }
.help-lede { color: var(--label-secondary); }

/* Card.tsx: secondary background, radius 8, the one standard shadow. */
.help-card {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-secondary);
  box-shadow: var(--card-shadow);
}

/* Q&A list: one card, items split by CardItemSeparator-style hairlines. */
.help-qa { padding-top: 4px; padding-bottom: 4px; }
.help-qa > div { padding: 12px 0; }
.help-qa > div + div { border-top: 1px solid var(--fill-secondary); }
.help-qa p { color: var(--label-secondary); }
.help-qa strong { color: var(--label-primary); font-weight: 600; }
.help-qa .help-chips { margin: 8px 0; line-height: 1.9; }

/* Chip.ts: highlight background, bold, brand-accent text. */
.help-chip {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--bg-highlight);
  color: var(--brand-accent);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Flowchart (inline SVG). */
.help-flow { padding: 16px 12px; }
.help-flow svg { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; }
.help-flow text {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: central;
}
.help-flow .fc-line { fill: none; stroke: var(--label-tertiary); stroke-width: 1.5; }
.help-flow .fc-head { fill: var(--label-tertiary); }
.help-flow .fc-label { fill: var(--label-secondary); font-size: 10px; font-weight: 600; }
.help-flow .fc-side { text-anchor: start; }
.help-flow .fc-start rect { fill: var(--bg-inverted); }
.help-flow .fc-start text { fill: var(--label-inverted); font-weight: 600; }
.help-flow .fc-ask rect { fill: var(--fill-secondary); }
.help-flow .fc-ask text { fill: var(--label-primary); }
.help-flow .fc-bolt { fill: var(--label-primary); stroke: var(--label-primary); stroke-width: 2; }
/* On the Accepting... / Rejecting... buttons the bolt takes the button's text color. */
.help-flow .fc-accept .fc-bolt,
.help-flow .fc-reject .fc-bolt { fill: currentColor; stroke: currentColor; }
/* Switch.tsx: brand track when on, tertiary when off, white thumb. */
.help-flow .fc-switch rect { fill: var(--label-tertiary); }
.help-flow .fc-switch-on rect { fill: var(--brand-primary); }
.help-flow .fc-switch circle { fill: #FFFFFF; }
/* Offer card buttons (Button.tsx): Accept is the brand fill, Reject the secondary stroke. */
.help-flow .fc-accept { color: #FFFFFF; }
.help-flow .fc-accept > rect,
.help-flow .fc-btn-accept rect { fill: var(--brand-primary); }
.help-flow .fc-reject { color: var(--label-primary); }
.help-flow .fc-reject > rect,
.help-flow .fc-btn-reject rect { fill: none; stroke: var(--label-primary); stroke-width: 1; }
.help-flow .fc-accept text,
.help-flow .fc-reject text { fill: currentColor; }
.help-flow .fc-you > rect { fill: var(--bg-secondary); stroke: var(--stroke); stroke-width: 1; }
.help-flow .fc-you > text { fill: var(--label-primary); font-weight: 600; }
.help-flow .fc-btn-accept text { fill: #FFFFFF; font-size: 10px; }
.help-flow .fc-btn-reject text { fill: var(--label-primary); font-size: 10px; }

/* "More guides": app-style list rows with a chevron. */
.help-links { padding-top: 0; padding-bottom: 0; }
.help-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  color: var(--label-primary);
  font-weight: 500;
  text-decoration: none;
}
.help-links a + a { border-top: 1px solid var(--fill-secondary); }
.help-links a::after { content: "›"; color: var(--label-tertiary); font-size: 20px; line-height: 1; }
[dir="rtl"] .help-links a::after { content: "‹"; }

/* Help Center home: a compact contact strip, headline and search, popular
   guides, then the rest, both as rows with a description. */
.help-contact {
  margin-top: 8px;
  padding: 12px 16px 14px;
  border-radius: 8px;
  background: var(--bg-secondary);
  box-shadow: var(--card-shadow);
}
.help-contact p { color: var(--label-secondary); font-size: 13px; }
/* The contact icons get their own row, spread across the card. */
.help-contact-icons { display: flex; justify-content: space-between; gap: 8px; max-width: 320px; margin-top: 10px; }
.help-contact-icons a { display: flex; }
.help-contact-icons .help-icon { width: 44px; height: 44px; }
.help .help-home-title { margin: 32px 0 8px; font-size: 32px; line-height: 1.15; }
.help-home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 0 14px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--label-secondary);
}
.help-home-search:focus-within { border-color: var(--brand-primary); }
.help-home-search input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--label-primary);
  font: inherit;
  font-size: 16px;
}
#help-home-results { padding: 6px; }
.help-row { display: flex; align-items: center; gap: 12px; }
.help-icon { width: 28px; height: 28px; flex: none; }
.help-guide { display: flex; flex-direction: column; gap: 2px; }
.help-guide-desc { color: var(--label-secondary); font-size: 13px; font-weight: 400; }

/* Icons (partials/help-icons.njk): app glyphs, sized per place. */
.help-icon-glyph { width: 20px; height: 20px; flex: none; }
.help-links .help-icon-glyph { color: var(--label-secondary); }
.help-title { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.help-title h1 { margin: 0; }
.help-title-icon { width: 30px; height: 30px; flex: none; color: var(--brand-primary); }
.help-guide-icon { width: 24px; height: 24px; flex: none; align-self: flex-start; margin-top: 1px; color: var(--brand-primary); }

/* Side menu. Phones: a panel that drops down under the header. Wide screens: always open beside the content. */
.help-drawer {
  position: fixed;
  z-index: 20;
  top: var(--header-h);
  right: 0;
  left: 0;
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  padding: 8px max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  border-radius: 0 0 12px 12px;
  background: var(--bg-secondary);
  box-shadow: var(--card-shadow);
  transform: translateY(calc(-100% - var(--header-h)));
  transition: transform 0.2s ease;
}
[data-drawer-open] .help-drawer { transform: none; }
.help-backdrop {
  position: fixed;
  z-index: 10;
  inset: var(--header-h) 0 0;
  background: #00000066;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
[data-drawer-open] .help-backdrop { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .help-drawer, .help-backdrop { transition: none; } }

.help-nav { display: flex; flex-direction: column; gap: 2px; }
.help-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--label-primary);
  font: inherit;
  font-weight: 500;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.help-nav-item:hover { background: var(--fill-secondary); }
.help-nav-item[aria-current="page"] { background: var(--fill-secondary); font-weight: 600; }
.help-nav-item[aria-current="page"] .help-icon-glyph { color: var(--brand-primary); }
.help-nav-divider { width: 100%; margin: 8px 0; border: 0; border-top: 1px solid var(--fill-secondary); }
.help-search { padding: 4px 0; }
.help-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--label-primary);
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming in on focus */
}
.help-result {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--label-primary);
  font-weight: 500;
  text-decoration: none;
}
.help-result:hover { background: var(--fill-secondary); }
.help-result small { display: block; margin-top: 2px; color: var(--label-secondary); font-size: 13px; font-weight: 400; }
.help-result-none { margin: 0; padding: 10px 12px; color: var(--label-secondary); }

@media (min-width: 900px) {
  .help-header,
  .help-footer { max-width: 920px; }
  .help-menu-btn,
  .help-backdrop { display: none; }
  .help-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 600px);
    gap: 40px;
    max-width: 920px;
    margin: 0 auto;
    padding: 0 max(16px, env(safe-area-inset-left));
  }
  .help-shell .help { max-width: none; margin: 0; padding: 0; }
  .help-drawer {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    align-self: start;
    width: auto;
    max-height: calc(100vh - var(--header-h) - 32px);
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transform: none;
    transition: none;
  }
  [data-app] .help-shell { display: block; max-width: 600px; }
}

/* Plain guides (partials/help-guide.njk): numbered steps and bullet lists in a card. */
.help-steps, .help-list { margin: 0; padding-inline-start: 22px; }
.help-steps li, .help-list li { padding-inline-start: 4px; }
.help-steps li + li, .help-list li + li { margin-top: 10px; }
.help-steps li::marker { color: var(--brand-primary); font-weight: 600; }
.help-list li::marker { color: var(--label-tertiary); }
.help-steps strong, .help-list strong { font-weight: 600; }

/* Gig app icons (images from the app) keep their own colors, with the app's rounded corners. */
.help-app-logo { border-radius: 22%; }
.help-title-icon.help-app-logo { width: 36px; height: 36px; }

/* Subpages in the side menu (each gig app under Supported apps). */
.help-nav-child { padding-inline-start: 28px; }

/* Footer: a row of contact icons under "Still stuck?". */
.help-footer .help-footer-contact { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.help-footer-contact a { display: flex; }
.help-footer-contact .help-icon { width: 32px; height: 32px; }

/* "More guides" lists every guide; the one you're on is marked, without a chevron. */
.help-links a[aria-current="page"] { color: var(--brand-primary); font-weight: 600; }
.help-links a[aria-current="page"] .help-icon-glyph { color: var(--brand-primary); }
.help-links a[aria-current="page"]::after { content: none; }

/* Supported apps: one section per app, its icon beside the name; the side menu links to #<app>. */
.help-app { scroll-margin-top: 16px; }
.help-app-title { display: flex; align-items: center; gap: 10px; }
.help-app-icon { width: 28px; height: 28px; flex: none; }
.help-app .help-card + .help-card { margin-top: 12px; }

/* Guide lists (Help Center home, "More guides"): the icon sits on the right, like
   Claude's help center, in place of the chevron. */
.help-guides a::after,
.help-more .help-links a::after { content: none; }
.help-guides .help-row,
.help-more .help-row { flex: 1; flex-direction: row-reverse; justify-content: space-between; }
.help-guides .help-guide-icon { align-self: center; margin-top: 0; }
