:root {
  color-scheme: light dark;

  --page-bg: #ffffff;
  --text-main: #161616;
  --text-muted: rgb(0 0 0 / 0.55);
  --text-soft: rgb(0 0 0 / 0.4);

  --card-bg: rgb(0 0 0 / 0.035);
  --card-border: rgb(0 0 0 / 0.08);

  --sheet-bg: rgb(255 255 255 / 0.6);
  --glass-bg-hover: rgb(0 0 0 / 1);
  --levitated-button-bg: rgb(241 241 241 / 0.6);

  --accent: #FF857A;

  --icon-filter: brightness(0) opacity(0.55);
  --icon-filter-hover: brightness(0) invert(1) opacity(0.8);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #0d0d0d;
    --text-main: #f5f5f5;
    --text-muted: rgb(255 255 255 / 0.6);
    --text-soft: rgb(255 255 255 / 0.4);

    --card-bg: rgb(255 255 255 / 0.045);
    --card-border: rgb(255 255 255 / 0.09);

    --sheet-bg: rgb(30 30 30 / 0.6);
    --glass-bg-hover: rgb(255 255 255 / 1);
    --levitated-button-bg: rgb(42 42 42 / 0.6);

    --accent: #F0A2B7;

    --icon-filter: brightness(0) invert(1) opacity(0.65);
    --icon-filter-hover: brightness(0) opacity(0.85);
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(96px, 12vw, 140px) clamp(20px, 5vw, 40px) 160px;
}

/* Back link (matches legal pages) */

.back-actions {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);

  z-index: 70;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 8px;

  height: 56px;
  padding: 0 20px 0 16px;

  border: 1px solid rgb(127 127 127 / 0.10);
  border-radius: 999px;
  background: var(--levitated-button-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  cursor: pointer;
  white-space: nowrap;

  font-size: 22px;
  font-weight: 400;
  text-decoration: none;
  color: var(--text-muted);

  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.10),
    0 4px 10px rgb(0 0 0 / 0.06);

  opacity: 0;
  filter: blur(20px);
  transform: translateY(120px) scale(0);

  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 900ms cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 900ms cubic-bezier(0.16, 1, 0.3, 1),
    background 240ms ease,
    color 240ms ease;
}

.back-link img {
  width: 16px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--icon-filter);
}

.back-link.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);

  transition-delay:
    1000ms,
    1000ms,
    1000ms,
    0ms,
    0ms;
}

.back-link:hover {
  background: var(--accent);
  color: var(--page-bg);
}

.back-link:hover img {
  filter: var(--icon-filter-hover);
}

.back-link.is-pressed,
.back-link:hover.is-pressed {
  transform: translateY(0) scale(0.85);

  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background 240ms ease,
    color 240ms ease;
}

/* Hero */

.help-hero {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 56px);
}

.app-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
}

.help-hero .eyebrow {
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}

.help-hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 16px;
}

.help-hero .subtitle {
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
}

/* Search */

.search-bar {
  position: sticky;
  top: 20px;
  z-index: 100;

  margin-top: clamp(28px, 4vw, 36px);
}

.search-bar.is-stuck {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.search-bar-inner {
  position: relative;

  max-width: 440px;
  margin: 0 auto;

  transition:
    max-width 420ms cubic-bezier(0.33, 1, 0.68, 1),
    width 420ms cubic-bezier(0.33, 1, 0.68, 1);
}

.search-bar.is-stuck .search-bar-inner {
  width: calc(100% - clamp(20px, 5vw, 40px) * 2);
  max-width: 1100px;
}

.search-icon {
  position: absolute;
  z-index: 101;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);

  width: 18px;
  height: 18px;
  color: var(--text-soft);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  height: 56px;

  padding: 0 20px 0 48px;

  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-main);

  font-size: 16px;
  font-family: inherit;

  transition: border-color 200ms ease, background 200ms ease, box-shadow 240ms ease;
}

.search-bar input::placeholder {
  color: var(--text-soft);
}

.search-bar input:focus {
  outline: none;
  border: 2px solid var(--accent);
  background: var(--page-bg);
}

.search-bar.is-stuck input {
  border: 1px solid rgb(127 127 127 / 0.10);
  background: var(--levitated-button-bg);

  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.10),
    0 4px 10px rgb(0 0 0 / 0.06);
}

/* Quick nav */

.quick-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;

  margin: clamp(28px, 4vw, 40px) 0 0;
}

.quick-nav a {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);

  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;

  transition: color 200ms ease, border-color 200ms ease;
}

.quick-nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* No-results state */

.no-results {
  display: none;

  font-size: 15px;
  color: var(--text-soft);
  text-align: center;

  margin: clamp(40px, 6vw, 56px) 0 0;
}

.no-results.is-visible {
  display: block;
}

/* FAQ categories */

.help-category {
  margin-top: clamp(56px, 8vw, 88px);
  scroll-margin-top: 40px;
}

.help-category.is-hidden {
  display: none;
}

.help-category h2 {
  font-size: clamp(22px, 2.6vw, 26px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card-bg);
  overflow: hidden;
}

.faq-item.is-hidden {
  display: none;
}

.faq-question {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding: 18px 22px;

  border: none;
  background: none;
  cursor: pointer;
  text-align: left;

  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);

  transition: background 200ms ease;
}

.faq-question:hover,
.faq-question:focus-visible {
  background: var(--card-border);
}

.faq-question:focus-visible {
  outline: none;
}

.faq-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;

  filter: var(--icon-filter);
  transition: transform 420ms cubic-bezier(0.34, 1.3, 0.64, 1);
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;

  transition:
    grid-template-rows 600ms cubic-bezier(0.1, 0, 0, 1),
    visibility 0s linear 600ms;
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
  visibility: visible;

  transition:
    grid-template-rows 600ms cubic-bezier(0.1, 0, 0, 1),
    visibility 0s linear 0s;
}

.faq-answer-inner {
  overflow: hidden;
}

.faq-answer-inner > * {
  padding-left: 22px;
  padding-right: 22px;
}

.faq-answer-inner > *:last-child {
  padding-bottom: 20px;
}

.faq-answer p,
.faq-answer ol,
.faq-answer ul {
  margin: 0 0 14px;

  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.faq-answer ol,
.faq-answer ul {
  padding-left: 40px;
}

.faq-answer li {
  margin-bottom: 6px;
}

.faq-answer li:last-child {
  margin-bottom: 0;
}

.faq-answer-inner > *:last-child {
  margin-bottom: 0;
}

.faq-answer a {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.compatibility-table-wrap {
  overflow-x: auto;
}

.compatibility-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;

  font-size: 13px;
}

.compatibility-table th,
.compatibility-table td {
  padding: 10px 14px;

  border-bottom: 1px solid var(--card-border);
  text-align: left;
  white-space: nowrap;
}

.compatibility-table td:nth-child(2),
.compatibility-table td:nth-child(3) {
  white-space: normal;
}

.compatibility-table th {
  font-weight: 600;
  color: var(--text-main);
}

.compatibility-table td {
  color: var(--text-muted);
}

.compatibility-table tbody tr:last-child td {
  border-bottom: none;
}

/* Contact card */

.contact-card {
  margin-top: clamp(72px, 10vw, 104px);
  padding: clamp(36px, 5vw, 48px) clamp(24px, 5vw, 40px);

  border-radius: 28px;
  background: var(--card-bg);
  text-align: center;
}

.contact-card h2 {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.contact-card p {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto;
}

.contact-button {
  display: inline-flex;
  align-items: center;

  height: 48px;
  padding: 0 28px;
  margin-top: 24px;

  border-radius: 999px;
  background: var(--accent);
  color: var(--page-bg);

  font-size: 15px;
  font-weight: 600;
  text-decoration: none;

  transition: opacity 200ms ease;
}

.contact-button:hover {
  opacity: 0.8;
}
