/* Long-form help guides (e.g. iOS share extension setup) on top of palatte.css */

.share-content:has(.help-guide) {
  padding-top: var(--s-lg);
}

.share-content:has(.help-guide) .card {
  margin: 0;
}

.help-article.help-guide {
  display: flex;
  flex-direction: column;
  gap: var(--s-xl);
  padding-bottom: var(--s-xl);
}

.help-hero {
  padding: 0 var(--s-xs) var(--s-sm);
}

.help-article h1 {
  margin: 0 0 var(--s-md);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--title);
}

.help-meta {
  margin: 0 0 var(--s-sm);
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

.help-meta a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

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

.help-article .lede {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-secondary);
  max-width: 36em;
}

.help-main.card {
  padding: var(--s-xl) var(--s-lg);
}

@media (min-width: 520px) {
  .help-main.card {
    padding: var(--s-xxxl) var(--s-section);
  }
}

.help-flow-step {
  scroll-margin-top: 72px;
}

.help-flow-step + .help-flow-step {
  margin-top: 0;
}

.help-step-label {
  margin: 0 0 var(--s-sm);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.help-flow-step > h2 {
  margin: 0 0 var(--s-md);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--title);
}

.help-flow-divider {
  margin: var(--s-xl) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.help-subtitle {
  margin: 0 0 var(--s-lg);
  font-size: 15px;
  line-height: 22px;
  color: var(--text-secondary);
  max-width: 34em;
}

.help-steps {
  margin: 0 0 var(--s-lg);
  padding-left: 1.35rem;
}

.help-flow-step .help-steps:last-of-type {
  margin-bottom: var(--s-md);
}

.help-steps li {
  margin-bottom: var(--s-md);
  padding-left: var(--s-xs);
  font-size: 15px;
  line-height: 24px;
}

.help-steps li:last-child {
  margin-bottom: 0;
}

.help-callout {
  margin: var(--s-lg) 0;
  padding: var(--s-md) var(--s-lg);
  border-radius: var(--chip-radius);
  border: 1px solid var(--ramp-4);
  background: var(--primary-tint);
  font-size: 14px;
  line-height: 22px;
}

.help-callout strong {
  color: var(--title);
}

/* ----- Source tabs (CSS-only) ----- */
.help-tabset {
  position: relative;
}

.help-tabset > input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.help-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
  margin-bottom: var(--s-lg);
  padding: var(--s-md);
  border-radius: var(--card-radius);
  background: var(--light-grey);
  border: 1px solid var(--border);
}

.help-source-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  min-height: 42px;
  padding: var(--s-sm) var(--s-md);
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease;
}

.help-source-tab__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  overflow: visible;
}

.help-source-tab__icon svg {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
}

.help-source-tab__text {
  line-height: 1.2;
}

/* Website — browser / globe */
.help-source-tab--website {
  color: #1a73e8;
  border-color: rgba(26, 115, 232, 0.35);
  background: rgba(26, 115, 232, 0.08);
}

.help-source-tab--website .help-source-tab__icon {
  color: #1a73e8;
}

/* Instagram */
.help-source-tab--instagram {
  color: #c13584;
  border-color: rgba(225, 48, 108, 0.35);
  background: rgba(225, 48, 108, 0.08);
}

.help-source-tab--instagram .help-source-tab__icon {
  color: #e1306c;
}

/* TikTok */
.help-source-tab--tiktok {
  color: #010101;
  border-color: rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, rgba(37, 244, 238, 0.12), rgba(254, 44, 85, 0.1));
}

.help-source-tab--tiktok .help-source-tab__icon {
  color: #010101;
}

/* Facebook */
.help-source-tab--facebook {
  color: #1877f2;
  border-color: rgba(24, 119, 242, 0.35);
  background: rgba(24, 119, 242, 0.08);
}

.help-source-tab--facebook .help-source-tab__icon {
  color: #1877f2;
}

/* YouTube */
.help-source-tab--youtube {
  color: #cc0000;
  border-color: rgba(255, 0, 0, 0.3);
  background: rgba(255, 0, 0, 0.08);
}

.help-yt-icon__bg {
  fill: #ff0000;
}

.help-yt-icon__play {
  fill: #fff;
}

.help-tabset #source-website:checked ~ .help-tab-bar .help-source-tab--website {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.35);
}

.help-tabset #source-website:checked ~ .help-tab-bar .help-source-tab--website .help-source-tab__icon {
  color: #fff;
}

.help-tabset #source-instagram:checked ~ .help-tab-bar .help-source-tab--instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.35);
}

.help-tabset #source-instagram:checked ~ .help-tab-bar .help-source-tab--instagram .help-source-tab__icon {
  color: #fff;
}

.help-tabset #source-tiktok:checked ~ .help-tab-bar .help-source-tab--tiktok {
  background: #010101;
  border-color: #010101;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.help-tabset #source-tiktok:checked ~ .help-tab-bar .help-source-tab--tiktok .help-source-tab__icon {
  color: #fff;
}

.help-tabset #source-facebook:checked ~ .help-tab-bar .help-source-tab--facebook {
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35);
}

.help-tabset #source-facebook:checked ~ .help-tab-bar .help-source-tab--facebook .help-source-tab__icon {
  color: #fff;
}

.help-tabset #source-youtube:checked ~ .help-tab-bar .help-source-tab--youtube {
  background: #ff0000;
  border-color: #ff0000;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.help-tabset #source-youtube:checked ~ .help-tab-bar .help-source-tab--youtube .help-yt-icon__bg {
  fill: #fff;
}

.help-tabset #source-youtube:checked ~ .help-tab-bar .help-source-tab--youtube .help-yt-icon__play {
  fill: #ff0000;
}

@media (hover: hover) {
  .help-source-tab--website:hover {
    border-color: #1a73e8;
    background: rgba(26, 115, 232, 0.14);
  }

  .help-source-tab--instagram:hover {
    border-color: #e1306c;
    background: rgba(225, 48, 108, 0.14);
  }

  .help-source-tab--tiktok:hover {
    border-color: #010101;
    background: linear-gradient(135deg, rgba(37, 244, 238, 0.2), rgba(254, 44, 85, 0.16));
  }

  .help-source-tab--facebook:hover {
    border-color: #1877f2;
    background: rgba(24, 119, 242, 0.14);
  }

  .help-source-tab--youtube:hover {
    border-color: #ff0000;
    background: rgba(255, 0, 0, 0.14);
  }
}

.help-tab-body {
  padding: var(--s-lg);
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.help-tab-panels {
  min-height: 0;
}

.help-tab-panel {
  display: none;
  animation: help-tab-in 0.2s ease;
}

@keyframes help-tab-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.help-tabset #source-website:checked ~ .help-tab-body .help-tab-panel[data-source="website"],
.help-tabset #source-instagram:checked ~ .help-tab-body .help-tab-panel[data-source="instagram"],
.help-tabset #source-tiktok:checked ~ .help-tab-body .help-tab-panel[data-source="tiktok"],
.help-tabset #source-facebook:checked ~ .help-tab-body .help-tab-panel[data-source="facebook"],
.help-tabset #source-youtube:checked ~ .help-tab-body .help-tab-panel[data-source="youtube"] {
  display: block;
}

.help-tab-panel .help-steps {
  margin: 0 0 var(--s-md);
}

.help-tab-note {
  margin: var(--s-lg) 0 0;
  padding: var(--s-md) var(--s-lg);
  border-radius: var(--chip-radius);
  background: var(--light-grey);
  font-size: 14px;
  line-height: 22px;
  color: var(--text-secondary);
}

.help-social-hint {
  margin: var(--s-xl) 0 0;
  padding-top: var(--s-lg);
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 22px;
  color: var(--text-muted);
  max-width: 36em;
}

/* ----- Collapsible sections ----- */
.help-disclosure {
  padding: 0;
  overflow: hidden;
}

.help-disclosure summary {
  list-style: none;
  cursor: pointer;
  padding: var(--s-lg) var(--s-section);
  font-size: 1rem;
  font-weight: 800;
  color: var(--title);
}

.help-disclosure summary::-webkit-details-marker {
  display: none;
}

.help-disclosure summary::after {
  content: "+";
  float: right;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}

.help-disclosure[open] summary::after {
  content: "−";
}

.help-disclosure summary:hover {
  background: var(--primary-tint);
}

.help-disclosure .help-disclosure-body {
  padding: 0 var(--s-section) var(--s-xl);
  border-top: 1px solid var(--border);
}

.help-disclosure .help-disclosure-body > :first-child {
  margin-top: var(--s-lg);
}

.help-disclosure .help-disclosure-body p {
  margin-bottom: var(--s-md);
  font-size: 15px;
  line-height: 24px;
  color: var(--text-secondary);
}

/* ----- Phone walkthrough (renders of the in-app Quick Start import demo) ----- */
.help-demo-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-xl) var(--s-md);
  counter-reset: demo-step;
}

@media (min-width: 520px) {
  .help-demo-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .help-demo-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--s-md);
  }
}

.help-demo-step {
  counter-increment: demo-step;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
  min-width: 0;
  text-align: center;
}

.help-demo-shot {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  margin: 0 auto var(--s-md);
}

.help-demo-title {
  margin: 0 0 var(--s-xs);
  font-size: 14px;
  line-height: 20px;
  color: var(--title);
}

.help-demo-title::before {
  content: counter(demo-step);
  display: inline-block;
  min-width: 20px;
  height: 20px;
  margin-right: var(--s-xs);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  vertical-align: 1px;
}

.help-demo-detail {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-muted);
}

.help-figure {
  margin: var(--s-lg) 0 0;
}

.help-figure--setup {
  margin-top: var(--s-xl);
}

.help-figure-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  padding: var(--s-lg);
  border-radius: var(--card-radius);
  border: 2px dashed var(--border);
  background: var(--light-grey);
  text-align: center;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-muted);
}

.help-figure img.help-screenshot {
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.help-figure figcaption {
  margin-top: var(--s-sm);
  font-size: 13px;
  line-height: 18px;
  color: var(--text-muted);
  text-align: center;
}

.help-faq dt {
  margin: var(--s-lg) 0 var(--s-xs);
  font-size: 15px;
  font-weight: 800;
  color: var(--title);
}

.help-faq dt:first-child {
  margin-top: 0;
}

.help-faq dd {
  margin: 0 0 var(--s-md);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 22px;
}

.share-content:has(.help-guide) .card.cta {
  margin-top: 0;
  padding: var(--s-xl) var(--s-section);
  text-align: center;
}

.share-content:has(.help-guide) .card.cta h2 {
  font-size: 1.1rem;
  margin-bottom: var(--s-sm);
}

.share-content:has(.help-guide) .card.cta p {
  margin-bottom: var(--s-lg);
  font-size: 15px;
  line-height: 22px;
  color: var(--text-secondary);
}

.share-content:has(.help-guide) .card.cta .btn {
  width: auto;
  min-width: 200px;
}

.help-store-link {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.help-store-link:hover {
  text-decoration: underline;
}

/* ----- Help hub & markdown articles ----- */
.help-guide--hub .help-hero {
  padding-bottom: var(--s-md);
}

.help-layout {
  display: grid;
  gap: var(--s-xl);
  align-items: start;
}

@media (min-width: 900px) {
  .help-layout {
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    gap: var(--s-section);
  }
}

.help-layout-main {
  display: flex;
  flex-direction: column;
  gap: var(--s-xl);
  min-width: 0;
}

.help-sidebar {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  padding: var(--s-md) var(--s-lg);
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.help-sidebar-label {
  margin: 0 0 var(--s-md);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

.help-sidebar-section {
  margin: var(--s-md) 0 var(--s-xs);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.help-sidebar-link {
  display: block;
  padding: var(--s-xs) 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

.help-sidebar-link:hover {
  color: var(--primary);
}

.help-sidebar-link--active {
  color: var(--primary);
}

.help-hub-featured {
  padding: var(--s-xl) var(--s-section);
}

.help-hub-featured-title {
  margin: 0 0 var(--s-sm);
  font-size: 1.1rem;
  font-weight: 800;
}

.help-hub-featured-text {
  margin: 0 0 var(--s-lg);
  font-size: 15px;
  line-height: 22px;
  color: var(--text-secondary);
}

.help-hub-section {
  margin: 0;
}

.help-hub-section-title {
  margin: 0 0 var(--s-md);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.help-hub-grid {
  display: grid;
  gap: var(--s-md);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: var(--s-xl);
}

.help-hub-card {
  display: block;
  padding: var(--s-lg);
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.help-hub-card:hover {
  border-color: var(--ramp-4);
  box-shadow: var(--shadow-md);
}

.help-hub-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 22px;
  color: var(--title);
}

.help-hero--compact h1 {
  margin-bottom: var(--s-sm);
}

.help-hero--compact .help-meta {
  margin-bottom: var(--s-xs);
}

.help-hero--compact .help-meta a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.help-hero--compact .help-meta a:hover {
  text-decoration: underline;
}

.help-prose.card {
  padding: var(--s-xl) var(--s-lg);
}

@media (min-width: 520px) {
  .help-prose.card {
    padding: var(--s-xxxl) var(--s-section);
  }
}

.help-prose h2 {
  margin: var(--s-xl) 0 var(--s-md);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--title);
}

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

.help-prose h3 {
  margin: var(--s-lg) 0 var(--s-sm);
  font-size: 1rem;
  font-weight: 800;
  color: var(--title);
}

.help-prose p {
  margin: 0 0 var(--s-md);
  font-size: 15px;
  line-height: 24px;
  color: var(--text-secondary);
}

.help-prose ul,
.help-prose ol {
  margin: 0 0 var(--s-lg);
  padding-left: 1.35rem;
}

.help-prose li {
  margin-bottom: var(--s-sm);
  font-size: 15px;
  line-height: 24px;
  color: var(--text-secondary);
}

.help-prose table {
  width: 100%;
  margin: 0 0 var(--s-lg);
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}

.help-prose th,
.help-prose td {
  padding: var(--s-sm) var(--s-md);
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.help-prose th {
  font-weight: 800;
  color: var(--title);
  background: var(--light-grey);
}

.help-prose a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

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

.help-prose code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--light-grey);
}

.help-prose hr {
  margin: var(--s-xl) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.help-back {
  margin: 0;
  font-size: 14px;
}

.help-back a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

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