/* ==========================================================================
   Naqqe Help Center — design system
   Mobile-first. Brand tokens taken from naqqe.com.
   ========================================================================== */

:root {
  /* Brand */
  --brand-500: #2bbf76;         /* Naqqe green — fills, accents (not for text) */
  --brand-600: #12a463;
  --brand-700: #00795a;         /* text/links/buttons on white — 5.4:1 */
  --brand-800: #005f47;
  --brand-50:  #eaf9f2;         /* mint surface */
  --brand-100: #d3f3e3;
  --sky-500:   #4fc3e8;         /* logo quote-mark blue — decorative only */
  --sky-50:    #eaf7fc;

  /* Neutrals */
  --ink-900: #1c1f2a;
  --ink-800: #2d3140;           /* Naqqe ink — headings */
  --ink-600: #4a5063;           /* body copy — 8.6:1 */
  --ink-500: #5f6577;           /* secondary — 5.9:1 */
  --ink-300: #c9ced8;
  --ink-200: #e3e7ee;
  --ink-100: #eff4f6;           /* Naqqe mist */
  --white:   #ffffff;

  /* Semantic */
  --color-bg: var(--white);
  --color-surface: var(--white);
  --color-subtle: #f7f9fb;
  --color-text: var(--ink-600);
  --color-heading: var(--ink-800);
  --color-muted: var(--ink-500);
  --color-border: var(--ink-200);
  --color-primary: var(--brand-700);
  --color-primary-hover: var(--brand-800);
  --color-ring: rgba(43, 191, 118, .45);
  --color-danger: #c62828;
  --color-danger-bg: #fdecec;
  --color-success-bg: var(--brand-50);

  /* Type */
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-xs: .8125rem;   /* 13 */
  --text-sm: .875rem;    /* 14 */
  --text-base: 1rem;     /* 16 */
  --text-lg: 1.125rem;   /* 18 */
  --text-xl: 1.25rem;    /* 20 */
  --text-2xl: 1.5rem;    /* 24 */
  --text-3xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --text-4xl: clamp(2rem, 1.4rem + 3vw, 3.25rem);

  /* Space (4px grid) */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem;

  /* Shape & depth */
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 24px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(28, 31, 42, .06);
  --shadow: 0 1px 3px rgba(28, 31, 42, .06), 0 4px 16px rgba(28, 31, 42, .06);
  --shadow-lg: 0 12px 40px rgba(28, 31, 42, .12);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-fast: 150ms; --dur: 220ms;

  --header-h: 64px;
  --container: 1160px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, h5, h6 { color: var(--color-heading); line-height: 1.25; margin: 0 0 var(--space-3); font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 var(--space-4); }
a { color: var(--color-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--color-primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--color-ring); outline-offset: 2px; border-radius: 6px; }
.icon { flex-shrink: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  background: var(--ink-900); color: var(--white); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--space-3); color: var(--white); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-4); }
@media (min-width: 768px) { .container { padding-inline: var(--space-6); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full); border: 1.5px solid transparent;
  font-weight: 700; font-size: var(--text-sm); line-height: 1.2; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary); color: var(--white); }
.btn-primary:hover { background: var(--color-primary-hover); color: var(--white); box-shadow: 0 6px 18px rgba(0, 121, 90, .25); }
.btn-secondary { background: var(--white); color: var(--ink-800); border-color: var(--ink-300); }
.btn-secondary:hover { border-color: var(--ink-800); color: var(--ink-900); }
.btn-ghost { background: transparent; color: var(--ink-800); }
.btn-ghost:hover { background: var(--ink-100); color: var(--ink-900); }
.btn-light { background: var(--white); color: var(--brand-800); }
.btn-light:hover { background: var(--brand-50); color: var(--brand-800); }
.btn-lg { min-height: 52px; padding-inline: var(--space-6); font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner { display: flex; align-items: center; gap: var(--space-4); height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); text-decoration: none; margin-right: auto; }
.brand img { height: 30px; width: auto; }
.brand__tag {
  font-size: var(--text-xs); font-weight: 700; color: var(--brand-700); background: var(--brand-50);
  padding: 2px var(--space-2); border-radius: var(--radius-full); letter-spacing: .02em;
}
.site-nav { display: none; }
.site-nav__list { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.site-nav__link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-3);
  border-radius: var(--radius-full); color: var(--ink-600); font-weight: 600; font-size: var(--text-sm);
  text-decoration: none; transition: background-color var(--dur-fast), color var(--dur-fast);
}
.site-nav__link:hover { background: var(--ink-100); color: var(--ink-900); }
.site-nav__link[aria-current="page"] { color: var(--brand-700); background: var(--brand-50); }
.site-header__actions { display: none; gap: var(--space-2); align-items: center; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-full); border: 0; background: transparent;
  color: var(--ink-800); cursor: pointer;
}
.nav-toggle:hover { background: var(--ink-100); }

@media (min-width: 992px) {
  .site-nav, .site-header__actions { display: flex; }
  .nav-toggle { display: none; }
  .brand { margin-right: var(--space-6); }
  .site-nav { margin-right: auto; }
}

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.drawer[data-open="true"] { visibility: visible; }
.drawer__backdrop {
  position: absolute; inset: 0; background: rgba(28, 31, 42, .45); opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 340px);
  background: var(--white); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; padding: var(--space-4);
  padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
  transform: translateX(100%); transition: transform var(--dur) var(--ease);
}
.drawer[data-open="true"] .drawer__backdrop { opacity: 1; }
.drawer[data-open="true"] .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.drawer__list { list-style: none; padding: 0; margin: 0 0 var(--space-6); }
.drawer__link {
  display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: 0 var(--space-3);
  border-radius: var(--radius); color: var(--ink-800); font-weight: 600; text-decoration: none;
}
.drawer__link:hover, .drawer__link[aria-current="page"] { background: var(--brand-50); color: var(--brand-800); }
.drawer__link .icon { color: var(--brand-600); }
.drawer__actions { margin-top: auto; display: grid; gap: var(--space-2); }
body.no-scroll { overflow: hidden; }

/* ---------- Hero (search-first) ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(79, 195, 232, .18), transparent 60%),
    radial-gradient(700px 380px at 0% 110%, rgba(43, 191, 118, .20), transparent 60%),
    linear-gradient(180deg, var(--brand-50), #f6fbf9);
  padding: var(--space-12) 0 var(--space-16);
}
.hero__inner { position: relative; max-width: 760px; margin-inline: auto; text-align: center; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-700); margin-bottom: var(--space-3);
}
.hero__title { font-size: var(--text-4xl); font-weight: 800; letter-spacing: -.025em; margin-bottom: var(--space-3); }
.hero__lead { font-size: var(--text-lg); color: var(--ink-600); margin: 0 auto var(--space-8); max-width: 34rem; }
.hero__quote { position: absolute; pointer-events: none; opacity: .9; }
.hero__quote--a { top: 24px; left: 4%; width: 54px; }
.hero__quote--b { bottom: 20px; right: 6%; width: 40px; transform: rotate(180deg); }
@media (max-width: 767px) { .hero__quote { display: none; } .hero { padding: var(--space-10) 0 var(--space-12); } }

/* ---------- Search ---------- */
.search { position: relative; text-align: left; }
.search__field {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--white); border: 1.5px solid var(--color-border); border-radius: var(--radius-full);
  padding: 6px 6px 6px var(--space-5); box-shadow: var(--shadow);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search__field:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--color-ring), var(--shadow); }
.search__field > .icon { color: var(--ink-500); }
.search__input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: var(--text-base); min-height: 44px; color: var(--ink-900);
}
.search__input::placeholder { color: var(--ink-500); }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear { display: none; border: 0; background: transparent; color: var(--ink-500); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; align-items: center; justify-content: center; }
.search__clear:hover { background: var(--ink-100); color: var(--ink-900); }
.search[data-has-value="true"] .search__clear { display: inline-flex; }
.search__submit { flex-shrink: 0; }
@media (max-width: 479px) { .search__submit .btn-label { display: none; } .search__submit { width: 44px; padding: 0; } }

.search__results {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--space-2); max-height: min(60vh, 420px); overflow-y: auto;
  list-style: none; margin: 0;
}
.search__results[hidden] { display: none; }
.search__option {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3);
  border-radius: var(--radius); color: var(--ink-800); text-decoration: none; min-height: 48px;
}
.search__option:hover, .search__option[aria-selected="true"] { background: var(--brand-50); color: var(--brand-800); }
.search__option .icon { color: var(--brand-600); }
.search__option-title { flex: 1; font-weight: 600; }
.search__option-type { font-size: var(--text-xs); color: var(--ink-500); text-transform: capitalize; }
.search__status { padding: var(--space-4); color: var(--ink-500); font-size: var(--text-sm); }
.search__status a { font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-top: var(--space-5); }
.chips__label { width: 100%; font-size: var(--text-sm); color: var(--ink-500); margin-bottom: var(--space-1); }
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--space-4);
  border-radius: var(--radius-full); background: rgba(255, 255, 255, .8); border: 1px solid var(--color-border);
  color: var(--ink-800); font-size: var(--text-sm); font-weight: 600; text-decoration: none;
  transition: border-color var(--dur-fast), background-color var(--dur-fast), color var(--dur-fast);
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-800); background: var(--white); }

/* ---------- Sections ---------- */
.section { padding: var(--space-12) 0; }
.section--subtle { background: var(--color-subtle); }
@media (min-width: 768px) { .section { padding: var(--space-16) 0; } }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.section__title { font-size: var(--text-2xl); margin: 0; }
.section__sub { color: var(--color-muted); margin: var(--space-1) 0 0; }
.link-arrow { display: inline-flex; align-items: center; gap: var(--space-1); font-weight: 700; text-decoration: none; font-size: var(--text-sm); }
.link-arrow .icon { transition: transform var(--dur-fast) var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid--3, .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-6); text-decoration: none; color: inherit;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
a.card:hover, .card--link:hover { border-color: var(--brand-500); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.card__icon {
  width: 48px; height: 48px; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-700); margin-bottom: var(--space-4);
}
.card:nth-child(3n+2) .card__icon { background: var(--sky-50); color: #11789c; }
.card__title { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.card__text {
  color: var(--color-muted); font-size: var(--text-sm); margin-bottom: var(--space-4);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__meta { margin-top: auto; display: flex; gap: var(--space-4); font-size: var(--text-xs); color: var(--ink-500); font-weight: 600; }
.card__meta span { display: inline-flex; align-items: center; gap: 6px; }
.card__arrow { position: absolute; top: var(--space-6); right: var(--space-6); color: var(--ink-300); transition: color var(--dur-fast), transform var(--dur-fast) var(--ease); }
a.card:hover .card__arrow { color: var(--brand-600); transform: translateX(3px); }

/* Compact, horizontal cards on phones */
@media (max-width: 599px) {
  .grid--3 > .card { display: grid; grid-template-columns: 44px 1fr; column-gap: var(--space-4); padding: var(--space-4) var(--space-10) var(--space-4) var(--space-4); }
  .grid--3 > .card .card__icon { grid-row: 1 / span 3; width: 44px; height: 44px; margin: 0; }
  .grid--3 > .card .card__title { font-size: var(--text-base); margin-bottom: 2px; }
  .grid--3 > .card .card__text { -webkit-line-clamp: 1; margin-bottom: var(--space-2); }
  .grid--3 > .card .card__arrow { top: 50%; right: var(--space-4); margin-top: -9px; }
  .grid--3 > .card .card__meta:empty { display: none; }
}

/* Quick action tiles (home) */
.tiles { display: grid; gap: var(--space-4); grid-template-columns: 1fr; margin-top: calc(var(--space-10) * -1); position: relative; z-index: 2; }
@media (min-width: 768px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: flex; gap: var(--space-4); align-items: flex-start; padding: var(--space-5);
  background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.tile:hover { border-color: var(--brand-500); transform: translateY(-2px); color: inherit; }
.tile__icon { width: 44px; height: 44px; border-radius: var(--radius); display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); flex-shrink: 0; }
.tile__title { font-size: var(--text-base); margin: 0 0 2px; }
.tile__text { font-size: var(--text-sm); color: var(--color-muted); margin: 0; }

/* ---------- Lists (articles, sections) ---------- */
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--white); overflow: hidden; }
.list__item + .list__item { border-top: 1px solid var(--color-border); }
.list__link {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5);
  min-height: 64px; text-decoration: none; color: inherit; transition: background-color var(--dur-fast);
}
.list__link:hover { background: var(--color-subtle); color: inherit; }
.list__icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); flex-shrink: 0; }
.list__body { flex: 1; min-width: 0; }
.list__title { display: block; font-weight: 700; color: var(--ink-800); line-height: 1.35; }
.list__link:hover .list__title { color: var(--brand-800); }
.list__desc { display: block; font-size: var(--text-sm); color: var(--color-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__meta { display: flex; gap: var(--space-3); font-size: var(--text-xs); color: var(--ink-500); font-weight: 600; margin-top: 4px; }
.list__chev { color: var(--ink-300); transition: color var(--dur-fast), transform var(--dur-fast) var(--ease); }
.list__link:hover .list__chev { color: var(--brand-600); transform: translateX(3px); }

/* compact list for sidebars / home columns */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li + li { border-top: 1px solid var(--color-border); }
.mini-list a {
  display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) 0;
  color: var(--ink-800); text-decoration: none; font-weight: 600; font-size: var(--text-sm); line-height: 1.45;
}
.mini-list a .icon { color: var(--brand-600); margin-top: 1px; }
.mini-list a:hover { color: var(--brand-800); }
.mini-list a:hover span { text-decoration: underline; text-underline-offset: 3px; }

.panel { background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5) var(--space-6); }
.panel__title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); margin-bottom: var(--space-2); }
.panel__title .icon { color: var(--brand-600); }

/* Skeleton loading */
.skeleton { display: block; height: 14px; border-radius: 6px; margin: var(--space-4) 0; background: linear-gradient(90deg, var(--ink-100), #f8fafb, var(--ink-100)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skeleton:nth-child(2n) { width: 80%; }
.skeleton:nth-child(3n) { width: 65%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Page header + breadcrumbs ---------- */
.page-header { background: linear-gradient(180deg, var(--brand-50), var(--white)); padding: var(--space-8) 0 var(--space-8); border-bottom: 1px solid var(--color-border); }
.page-header__title { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -.02em; margin: 0; overflow-wrap: anywhere; }
.page-header__lead { color: var(--color-muted); margin: var(--space-2) 0 0; max-width: 46rem; }
.page-header .search { margin-top: var(--space-6); max-width: 640px; }
.breadcrumbs { margin-bottom: var(--space-3); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--ink-500); }
.breadcrumbs li + li::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--ink-300); border-top: 1.5px solid var(--ink-300); transform: rotate(45deg); margin: 0 var(--space-2) 0 var(--space-1); }
.breadcrumbs a { color: var(--ink-600); text-decoration: none; font-weight: 600; }
.breadcrumbs a:hover { color: var(--brand-800); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--ink-800); font-weight: 600; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Two-column layout ---------- */
.layout { display: grid; gap: var(--space-8); grid-template-columns: 1fr; padding: var(--space-8) 0 var(--space-16); }
@media (min-width: 992px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-12); padding-top: var(--space-10); }
  .layout__aside { position: sticky; top: calc(var(--header-h) + var(--space-6)); align-self: start; }
}
.layout__aside { display: grid; gap: var(--space-4); }

/* ---------- Article ---------- */
.article { background: var(--white); }
.article__meta { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: var(--text-sm); color: var(--ink-500); margin-top: var(--space-3); }
.article__meta span { display: inline-flex; align-items: center; gap: 6px; }
.prose { font-size: 1.0625rem; line-height: 1.75; color: var(--ink-600); max-width: 70ch; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1em; }
.prose p { margin: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.8em 0 .6em; }
.prose h1 { font-size: var(--text-2xl); } .prose h2 { font-size: var(--text-xl); } .prose h3, .prose h4 { font-size: var(--text-lg); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0; }
.prose li + li { margin-top: .4em; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; height: auto !important; max-width: 100% !important; }
.prose a { font-weight: 600; }
.prose blockquote { margin: 1.5em 0; padding: var(--space-4) var(--space-5); border-left: 4px solid var(--brand-500); background: var(--brand-50); border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-800); }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--color-border); padding: var(--space-2) var(--space-3); text-align: left; }
.prose iframe, .prose video { max-width: 100%; border-radius: var(--radius); }

.helpful { margin-top: var(--space-10); padding: var(--space-5) var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-lg); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); background: var(--color-subtle); }
.helpful p { margin: 0; font-weight: 700; color: var(--ink-800); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: var(--space-12) var(--space-6); border: 1px dashed var(--ink-300); border-radius: var(--radius-lg); background: var(--color-subtle); }
.empty__icon { width: 56px; height: 56px; margin: 0 auto var(--space-4); border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--brand-600); box-shadow: var(--shadow-sm); }
.empty h2, .empty h3 { font-size: var(--text-lg); }
.empty p { color: var(--color-muted); max-width: 30rem; margin-inline: auto; }

/* ---------- CTA band ---------- */
.cta {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #0a6e52 0%, var(--brand-700) 45%, #0e8f6a 100%);
  color: var(--white); padding: var(--space-8) var(--space-6);
  display: grid; gap: var(--space-6); align-items: center;
}
.cta::after { content: ""; position: absolute; width: 380px; height: 380px; right: -120px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(79, 195, 232, .35), transparent 70%); pointer-events: none; }
.cta h2 { color: var(--white); font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.cta p { margin: 0; color: rgba(255, 255, 255, .88); }
.cta__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); position: relative; z-index: 1; }
.cta .btn-outline-light { border-color: rgba(255, 255, 255, .6); color: var(--white); background: transparent; }
.cta .btn-outline-light:hover { background: rgba(255, 255, 255, .12); color: var(--white); border-color: var(--white); }
@media (min-width: 768px) { .cta { grid-template-columns: 1fr auto; padding: var(--space-10) var(--space-12); } }

/* App download band */
.app-band { display: grid; gap: var(--space-6); align-items: center; padding: var(--space-8) var(--space-6); border-radius: var(--radius-xl); background: var(--ink-100); }
.app-band h2 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.app-band p { margin: 0; color: var(--ink-600); }
@media (min-width: 768px) { .app-band { grid-template-columns: 1fr auto; padding: var(--space-10) var(--space-12); } }
.store-badges { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.store-badges a { display: inline-block; border-radius: 10px; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast); }
.store-badges a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.store-badges img { height: 48px; width: auto; }

/* ---------- Forms ---------- */
.form-card { background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); }
@media (min-width: 768px) { .form-card { padding: var(--space-8); } }
.form-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-weight: 700; font-size: var(--text-sm); color: var(--ink-800); }
.field__label .req { color: var(--color-danger); margin-left: 2px; }
.field__hint { font-size: var(--text-xs); color: var(--ink-500); }
.field__error { display: none; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--color-danger); font-weight: 600; }
.field[data-invalid="true"] .field__error { display: flex; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--ink-300); border-radius: var(--radius); background: var(--white); color: var(--ink-900);
  font-size: var(--text-base); transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
.select { appearance: none; padding-right: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f6577' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .textarea::placeholder { color: #8a90a0; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-500); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--color-ring); }
.field[data-invalid="true"] .input, .field[data-invalid="true"] .textarea, .field[data-invalid="true"] .select { border-color: var(--color-danger); }
.field[data-invalid="true"] .input:focus, .field[data-invalid="true"] .textarea:focus { box-shadow: 0 0 0 4px rgba(198, 40, 40, .18); }

/* Custom select */
.cselect { position: relative; }
.cselect__trigger {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 48px;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4); text-align: left; cursor: pointer;
  background: var(--white); color: var(--ink-900); border: 1.5px solid var(--ink-300); border-radius: var(--radius);
  font-size: var(--text-base); transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.cselect__trigger:hover { border-color: var(--ink-500); }
.cselect__trigger:focus-visible, .cselect.is-open .cselect__trigger { outline: 0; border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--color-ring); }
.cselect__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cselect__caret { color: var(--ink-500); display: inline-flex; transition: transform var(--dur) var(--ease); }
.cselect.is-open .cselect__caret { transform: rotate(180deg); }
.cselect__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cselect__ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--brand-50); color: var(--brand-700); flex-shrink: 0; }
.cselect__list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: var(--space-2); list-style: none; max-height: 300px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98); transform-origin: top center;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility 0s linear var(--dur-fast);
}
.cselect.is-up .cselect__list { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
.cselect.is-open .cselect__list { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.cselect__opt {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); min-height: 48px;
  border-radius: var(--radius); cursor: pointer; color: var(--ink-800);
}
.cselect__opt.is-active { background: var(--color-subtle); }
.cselect__opt[aria-selected="true"] { background: var(--brand-50); }
.cselect__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cselect__label { font-weight: 600; line-height: 1.3; }
.cselect__desc { font-size: var(--text-xs); color: var(--ink-500); line-height: 1.4; margin-top: 2px; }
.cselect__check { color: var(--brand-700); opacity: 0; display: inline-flex; }
.cselect__opt[aria-selected="true"] .cselect__check { opacity: 1; }
.field[data-invalid="true"] .cselect__trigger { border-color: var(--color-danger); }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-6); border: 1.5px dashed var(--ink-300); border-radius: var(--radius); background: var(--color-subtle);
  text-align: center; cursor: pointer; transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.dropzone:hover, .dropzone[data-drag="true"] { border-color: var(--brand-500); background: var(--brand-50); }
.dropzone:focus-within { outline: 3px solid var(--color-ring); outline-offset: 2px; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .icon { color: var(--brand-600); }
.dropzone strong { color: var(--ink-800); }
.dropzone span { font-size: var(--text-sm); color: var(--ink-500); }
.file-preview { display: none; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius); margin-top: var(--space-3); }
.file-preview[data-show="true"] { display: flex; }
.file-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); background: var(--ink-100); }
.file-preview__name { flex: 1; min-width: 0; font-size: var(--text-sm); font-weight: 600; color: var(--ink-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-actions { display: flex; flex-direction: column-reverse; gap: var(--space-3); margin-top: var(--space-2); }
@media (min-width: 640px) { .form-actions { flex-direction: row; justify-content: flex-end; } }

.alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4) var(--space-5); border-radius: var(--radius); margin-bottom: var(--space-5); font-weight: 600; }
.alert[hidden] { display: none; }
.alert--success { background: var(--color-success-bg); color: var(--brand-800); border: 1px solid var(--brand-100); }
.alert--error { background: var(--color-danger-bg); color: #8e1c1c; border: 1px solid #f6caca; }
.alert p { margin: 0; }

.spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: var(--white); border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.btn[aria-busy="true"] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Info list (support page / ticket aside) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); counter-reset: step; }
.steps li { display: flex; gap: var(--space-3); font-size: var(--text-sm); }
.steps li::before { counter-increment: step; content: counter(step); flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: var(--text-xs); display: grid; place-items: center; }
.steps strong { display: block; color: var(--ink-800); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; overflow: hidden; margin-top: var(--space-16);
  background: radial-gradient(800px 360px at 100% 0%, rgba(43, 191, 118, .14), transparent 60%),
              radial-gradient(600px 300px at 0% 100%, rgba(79, 195, 232, .10), transparent 60%), var(--ink-900);
  color: #b9bfcc; font-size: var(--text-sm);
}
.site-footer__mark { position: absolute; right: -30px; top: 40px; width: 260px; fill: rgba(255, 255, 255, .03); pointer-events: none; }
.site-footer a { color: #d9dde5; text-decoration: none; }
.site-footer a:hover { color: var(--white); }
.site-footer :focus-visible { outline-color: var(--brand-500); }

.footer-top { display: grid; gap: var(--space-8); padding: var(--space-12) 0 var(--space-10); border-bottom: 1px solid rgba(255, 255, 255, .08); }
@media (min-width: 992px) { .footer-top { grid-template-columns: 1fr 1fr; align-items: center; gap: var(--space-12); } }
.footer-top--solo { grid-template-columns: 1fr !important; }
.footer-brand__logo { display: inline-block; }
.footer-brand__logo img { height: 32px; width: auto; filter: brightness(0) invert(1); }
.footer-brand__tag { margin: var(--space-4) 0 var(--space-6); max-width: 24rem; color: #b9bfcc; font-size: var(--text-base); }
.footer-label { margin: 0 0 var(--space-3); font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8d94a5; }
.site-footer .store-badges img { height: 44px; }
.site-footer .store-badges a { border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }

.footer-help {
  display: grid; gap: var(--space-4); grid-template-columns: auto 1fr; align-items: center;
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
}
.footer-help__icon { width: 48px; height: 48px; border-radius: var(--radius); display: grid; place-items: center; background: rgba(43, 191, 118, .16); color: var(--brand-500); }
.footer-help__title { margin: 0; color: var(--white); font-weight: 700; font-size: var(--text-lg); }
.footer-help__text { margin: 2px 0 0; color: #b9bfcc; }
.footer-help__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.footer-help__actions .btn { flex: 1 1 auto; }
@media (min-width: 600px) { .footer-help { grid-template-columns: auto 1fr auto; padding: var(--space-6); } .footer-help__actions { grid-column: auto; } .footer-help__actions .btn { flex: 0 0 auto; } }
@media (min-width: 992px) { .footer-help { grid-template-columns: auto 1fr; } .footer-help__actions { grid-column: 2; } }
.footer-btn-ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .28); }
.footer-btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .6); color: var(--white); }

/* link columns: accordions on phones, columns from 768px */
.footer-links { display: grid; grid-template-columns: 1fr; padding: var(--space-4) 0; }
.footer-acc { border-bottom: 1px solid rgba(255, 255, 255, .08); }
.footer-acc summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 56px; cursor: pointer; list-style: none;
  color: var(--white); font-weight: 700; font-size: var(--text-base);
}
.footer-acc summary::-webkit-details-marker { display: none; }
.footer-acc__chev { color: #8d94a5; transition: transform var(--dur) var(--ease); }
.footer-acc[open] .footer-acc__chev { transform: rotate(90deg); }
.footer-acc ul { list-style: none; margin: 0; padding: 0 0 var(--space-4); display: grid; gap: 2px; }
.footer-acc li a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; min-height: 40px; line-height: 1.4; }
.footer-acc li a:hover { color: var(--brand-500); }
.footer-ext { opacity: .55; }
@media (min-width: 768px) {
  .footer-links { grid-template-columns: repeat(4, 1fr); gap: var(--space-8); padding: var(--space-10) 0 var(--space-8); }
  .footer-acc { border: 0; }
  .footer-acc summary { min-height: 0; margin-bottom: var(--space-3); cursor: default; pointer-events: none; font-size: var(--text-sm); }
  .footer-acc__chev { display: none; }
  .footer-acc ul { padding: 0; }
  .footer-acc li a { min-height: 36px; padding: 6px 0; }
}

.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) 0; padding-bottom: max(var(--space-6), env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-bottom p { margin: 0; color: #8d94a5; }
.footer-top-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .2); color: var(--white) !important; transition: background-color var(--dur-fast), border-color var(--dur-fast); }
.footer-top-btn:hover { background: var(--brand-700); border-color: var(--brand-700); }

/* ---------- Motion preferences ---------- */
.reveal { animation: reveal .45s var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Keep the chat widget clear of the iOS home indicator */
#botmanWidgetRoot > div { bottom: max(16px, env(safe-area-inset-bottom)) !important; }

/* Phones: collapse breadcrumbs to a single back link to the parent page */
@media (max-width: 599px) {
  .breadcrumbs li { display: none; }
  .breadcrumbs li:nth-last-child(2) { display: inline-flex; }
  .breadcrumbs li:nth-last-child(2)::before { content: none; }
  .breadcrumbs li:nth-last-child(2) a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
  .breadcrumbs li:nth-last-child(2) a::before { content: "←"; font-weight: 700; }
}

/* Don't let the chat bubble cover the open menu */
body.no-scroll #botmanWidgetRoot { display: none; }
