/* Help center (/help/…): home, topics, articles, search results and the
   contact page. Its surfaces are the site's cards: white, set apart by a
   hairline, 18 px corners. Hover and the current page take a faint tint of
   the brand blue; the neutral fill stays for buttons. */

:root {
  --help-hover: color-mix(in srgb, var(--brand) 4%, var(--bg-card));
  --help-soft: #f8f9fb; /* table heads, the answer box: barely off-white */
  --help-pad: 20px; /* inside every list, card and answer */
}

.help {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 0 20px 72px;
}

@media (min-width: 640px) {
  .help {
    padding: 0 32px 96px;
  }
}

.help-page {
  padding-top: 24px;
}

@media (min-width: 640px) {
  .help-page {
    padding-top: 32px;
  }
}

.help h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.help-section {
  margin: 0 0 48px;
}

/* Search ------------------------------------------------------------------ */

.help-hero {
  padding-bottom: 56px;
}

.help-search {
  position: relative;
  max-width: 560px;
  margin: 0 0 32px;
}

.help-search-large {
  margin: 32px auto 0;
}

.help-search svg {
  position: absolute;
  inset-inline-start: 18px;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-tertiary);
  pointer-events: none;
}

.help-search input {
  width: 100%;
  height: 48px;
  padding: 0 20px 0 46px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  transition:
    border-color 0.2s var(--ease-apple),
    box-shadow 0.2s var(--ease-apple);
}

.help-search-large input {
  height: 56px;
  box-shadow: var(--shadow-sm);
}

.help-search input::placeholder {
  color: var(--ink-tertiary);
}

.help-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.help-suggest[hidden] {
  display: none;
}

.help-results[hidden],
[data-help-browse][hidden] {
  display: none;
}

.help-results {
  margin: 0 0 48px;
}

.help-results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 14px;
}

.help-results-head h2 {
  margin: 0;
}

.help-results-head p {
  margin: 0;
  color: var(--ink-tertiary);
  font-size: 15px;
}

.help-no-results {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
}

.help-no-results p {
  max-width: 52ch;
  margin: 0;
  color: var(--ink-secondary);
}

.help mark {
  border-radius: 3px;
  background: var(--brand-tint);
  color: inherit;
}

/* Breadcrumb -------------------------------------------------------------- */

.help-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.help-crumbs li {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-tertiary);
}

.help-crumbs li + li::before {
  content: "›";
  color: var(--ink-tertiary);
}

.help-crumbs a {
  color: var(--ink-secondary);
  text-decoration: none;
}

.help-crumbs a:hover {
  color: var(--brand);
}

.help-crumbs [aria-current] {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* Topic and contact headings ---------------------------------------------- */

.help-heading {
  margin: 0 0 28px;
}

.help-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.help-heading .help-topic-icon {
  margin-bottom: 16px;
}

.help-heading .lead {
  margin: 10px 0 0;
  color: var(--ink-secondary);
  font-size: 19px;
  line-height: 1.4;
  text-wrap: pretty;
}

/* Topic tiles -------------------------------------------------------------- */

.help-topics {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-topic {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 0.2s var(--ease-apple),
    box-shadow 0.2s var(--ease-apple),
    translate 0.2s var(--ease-apple);
}

.help-topic:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  translate: 0 -2px;
}

.help-topic:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .help-topic:hover {
    translate: none;
  }
}

.help-topic-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand);
}

.help-topic-title {
  margin: 16px 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.help-topic-text {
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.45;
  text-wrap: pretty;
}

.help-topic-count {
  margin-top: 16px;
  color: var(--ink-tertiary);
  font-size: 13px;
}

/* Phones: one compact row per topic, the icon beside the text. */
@media (max-width: 639px) {
  .help-topics {
    gap: 10px;
  }

  .help-topic {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto;
    column-gap: 14px;
    align-items: start;
    padding: 16px 18px;
  }

  .help-topic .help-topic-icon {
    grid-row: 1 / span 3;
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .help-topic-title {
    margin: 0 0 2px;
  }

  .help-topic-count {
    margin-top: 6px;
  }
}

/* Article rows: one grouped list, as in the app's settings. ---------------- */

.help-rows {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  list-style: none;
  overflow: hidden;
}

/* Dividers start under the text, as in iOS lists. */
.help-rows li {
  position: relative;
}

.help-rows li + li::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: var(--help-pad) 0;
  height: 1px;
  background: var(--line);
}

.help-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px var(--help-pad);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.15s var(--ease-apple);
}

.help-row:hover {
  background: var(--help-hover);
}

.help-row:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.help-row-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.help-row-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.help-row-summary {
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.4;
  text-wrap: pretty;
}

.help-row-meta {
  margin-top: 2px;
  color: var(--ink-tertiary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.help-row .chevron {
  flex: none;
  margin-inline-start: auto;
  color: var(--ink-tertiary);
  transition:
    color 0.15s var(--ease-apple),
    translate 0.15s var(--ease-apple);
}

.help-row:hover .chevron {
  color: var(--brand);
  translate: 2px 0;
}

/* Article ------------------------------------------------------------------ */

.help-article {
  min-width: 0;
}

.help-article h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.help-article header .lead {
  margin: 12px 0 0;
  color: var(--ink-secondary);
  font-size: 19px;
  line-height: 1.45;
  text-wrap: pretty;
}

.help-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 16px 0 0;
  color: var(--ink-tertiary);
  font-size: 13px;
}

.help-toc {
  margin: 28px 0 0;
  padding: 18px var(--help-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
}

.help-toc h2 {
  margin: 0 0 8px;
  color: var(--ink-tertiary);
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* No counters: some headings carry their own step number. */
.help-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.7;
}

.help-toc a {
  color: var(--brand);
  text-decoration: none;
}

.help-toc a:hover {
  text-decoration: underline;
}

/* Prose */
.help-prose {
  margin-top: 32px;
  font-size: 17px;
  line-height: 1.65;
  counter-reset: none;
}

.help-prose > * + * {
  margin-top: 16px;
}

.help-prose h2 {
  margin: 40px 0 0;
  font-size: 24px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.help-prose h3 {
  margin: 28px 0 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.help-prose h2 + *,
.help-prose h3 + * {
  margin-top: 10px;
}

.help-prose p,
.help-prose ul,
.help-prose ol {
  margin-bottom: 0;
  text-wrap: pretty;
}

.help-prose > :first-child {
  margin-top: 0;
}

.help-prose ul {
  padding-inline-start: 22px;
}

.help-prose li + li {
  margin-top: 6px;
}

/* Numbered steps, as round counters. */
.help-prose ol {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.help-prose ol > li {
  position: relative;
  padding-inline-start: 40px;
  counter-increment: step;
}

.help-prose ol > li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.help-prose ol > li + li {
  margin-top: 12px;
}

.help-prose strong {
  font-weight: 600;
}

.help-prose a {
  color: var(--brand);
}

.help-prose code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--fill);
  font-size: 0.9em;
}

.help-prose figure {
  margin: 24px 0 0;
}

.help-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background: var(--help-soft);
}

.help-prose figcaption {
  margin-top: 8px;
  color: var(--ink-tertiary);
  font-size: 14px;
}

.help-prose .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
}

.help-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.help-prose th,
.help-prose td {
  padding: 10px 14px;
  text-align: start;
  vertical-align: top;
}

.help-prose th {
  background: var(--help-soft);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
}

.help-prose tr + tr td,
.help-prose tbody tr:first-child td {
  border-top: 1px solid var(--line);
}

.callout {
  --tint: var(--brand);
  --tint-ink: var(--brand-strong);
  padding: 16px var(--help-pad);
  border: 1px solid color-mix(in srgb, var(--tint) 18%, transparent);
  border-radius: var(--radius-tile);
  background: color-mix(in srgb, var(--tint) 6%, var(--bg-card));
  font-size: 16px;
  line-height: 1.55;
}

.callout > * + * {
  margin-top: 6px;
}

.callout p {
  margin: 0;
}

.callout .callout-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--tint-ink);
}

.callout-tip {
  --tint: var(--green);
  --tint-ink: #1f7a37;
}

.callout-warning {
  --tint: var(--orange);
  --tint-ink: #b25f00;
}

.help-related {
  margin: 56px 0 0;
}

.help-related + .help-band {
  margin-top: 40px;
}

/* Contact band ------------------------------------------------------------- */

/* The hero's pastel halo again: the page ends where it began. */
.help-band {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 56px;
  padding: 48px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--wash);
  text-align: center;
}

.help-band h2 {
  margin: 0;
}

.help-band p {
  max-width: 46ch;
  margin: 0 0 8px;
  color: var(--ink-secondary);
  text-wrap: pretty;
}

/* Contact page ------------------------------------------------------------- */

.help-contact-page .card {
  border: 1px solid var(--line);
}

.help-mail {
  margin: 20px 0 0;
  color: var(--ink-secondary);
  font-size: 15px;
}

.help-mail a {
  color: var(--brand);
}

.help-about {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-tile);
  background: var(--brand-tint);
  color: var(--ink-secondary);
  font-size: 15px;
}

.help-about[hidden] {
  display: none;
}

.help-about a {
  color: var(--brand-strong);
  font-weight: 600;
}

.field select {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-tile);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      no-repeat right 16px center,
    var(--bg-card);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  appearance: none;
}

.field select:invalid {
  color: var(--ink-tertiary);
}

.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.help-diagnostics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background: var(--help-soft);
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.4;
}

.help-diagnostics[hidden] {
  display: none;
}

.help-diagnostics span:first-child {
  color: var(--ink);
  font-weight: 600;
}

/* Topic headings of the troubleshooting page link to the topic. */
.help-section h2 a {
  color: inherit;
  text-decoration: none;
}

.help-section h2 a:hover {
  color: var(--brand);
}

/* Two columns: the topics on the left, the page on the right. -------------- */

.help-docs {
  display: grid;
  gap: 0;
  max-width: var(--container-wide);
  padding-top: 24px;
}

@media (min-width: 1024px) {
  .help-docs {
    grid-template-columns: 272px minmax(0, 1fr);
    gap: 56px;
    padding-top: 32px;
  }
}

.help-main {
  min-width: 0;
  /* The one width of everything in the column: breadcrumb, text, lists,
     the form and the contact band line up on both edges. */
  max-width: 760px;
}

/* Left navigation */
.help-nav {
  margin: 0 0 28px;
}

@media (min-width: 1024px) {
  .help-nav {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 32px);
    margin: 0;
    padding-bottom: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

.help-nav .help-search {
  margin: 0 0 16px;
}

.help-nav .help-search input {
  height: 42px;
  font-size: 16px;
}

.help-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.15s var(--ease-apple), color 0.15s var(--ease-apple);
}

.help-nav-list a:hover {
  background: var(--help-hover);
  color: var(--ink);
}

/* The current topic: its own page, or the topic of the article read. */
.help-nav-list a[aria-current] {
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-weight: 600;
}

.help-nav-topic > a svg {
  flex: none;
  color: var(--brand);
}

/* Under the related articles: back to the whole topic. */
.help-all {
  margin: 14px 0 0;
  font-size: 15px;
  font-weight: 500;
}

.help-all a::after {
  content: " ›";
}

.help-nav-extra {
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--line);
}

/* Phones and tablets: the topics fold behind a button. */
.help-nav-toggle {
  display: none;
}

@media (max-width: 1023px) {
  .help-nav-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-tile);
    background: var(--bg-card);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
  }

  .help-nav-toggle::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-inline-start: auto;
    border-right: 1.8px solid var(--ink-tertiary);
    border-bottom: 1.8px solid var(--ink-tertiary);
    rotate: 45deg;
    translate: 0 -2px;
    transition: rotate 0.2s var(--ease-apple);
  }

  .help-nav-toggle[aria-expanded="true"]::after {
    rotate: 225deg;
    translate: 0 2px;
  }

  .help-nav-current {
    overflow: hidden;
    color: var(--ink-tertiary);
    font-weight: 400;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .help-nav-current:not(:empty)::before {
    content: "· ";
  }

  .js .help-nav-list {
    display: none;
  }

  .help-nav[data-open] .help-nav-list {
    display: block;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-tile);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
  }
}

.help-docs .help-section {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.help-prose pre {
  margin: 16px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: var(--radius-tile);
  background: #1d1d1f;
  color: #f5f5f7;
  font-size: 13.5px;
  line-height: 1.55;
}

.help-prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
}

/* "This help center is also available in French." --------------------- */

.help-lang {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin: 0;
  padding: 10px 48px 10px 20px;
  position: relative;
  background: var(--brand-tint);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

.help-lang[hidden] {
  display: none;
}

.help-lang a {
  font-weight: 600;
}

.help-lang button {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.help-lang button:hover {
  background: var(--fill);
}


/* "Was this helpful?" under the article. ------------------------------------ */

.help-vote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 40px;
  padding: 16px var(--help-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
}

.help-vote p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.help-vote-buttons {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
}

.help-vote-buttons[hidden] {
  display: none;
}

.help-vote button {
  min-width: 72px;
  height: 36px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.15s var(--ease-apple),
    border-color 0.15s var(--ease-apple),
    color 0.15s var(--ease-apple);
}

.help-vote button:hover {
  border-color: color-mix(in srgb, var(--brand) 25%, transparent);
  background: var(--help-hover);
  color: var(--brand-strong);
}

.help-vote button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.help-vote-done a {
  font-weight: 600;
}

/* Phones: the buttons under the question, on the left. */
@media (max-width: 639px) {
  .help-vote-buttons {
    margin-inline-start: 0;
  }
}
