/* =========================================================================
   RNX Consulting — design system
   Premium, minimalist, Apple-inspired. Black / white / soft-grey + muted gold.
   ========================================================================= */

:root {
  --bg: #ffffff;
  --ink: #0b0b0c;          /* matte black */
  --ink-soft: #2a2a2e;
  --muted: #6b7280;        /* secondary text */
  --line: #e9e4db;         /* warm hairline borders */
  --surface: #f8f5ef;      /* warm ivory — section & card fill */
  --surface-2: #f0eade;    /* deeper warm tint */

  --gold: #b08d57;         /* muted gold accent */
  --gold-deep: #94733f;    /* deeper gold — icons, borders, hover, large text */
  --gold-soft: #f3ecdd;    /* gold tint */
  --gold-text: #7a5d2e;    /* darkest gold — small text; passes WCAG AA on white & gold-soft */

  --shadow-sm: 0 1px 2px rgba(16, 16, 18, .04);
  --shadow-md: 0 1px 2px rgba(16, 16, 18, .04), 0 12px 32px rgba(16, 16, 18, .07);
  --shadow-lg: 0 2px 4px rgba(16, 16, 18, .04), 0 30px 60px rgba(16, 16, 18, .10);

  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 22px;

  --maxw: 1200px;
  --gut: clamp(20px, 5vw, 40px);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.08; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- buttons ---------- */
.btn {
  --bsize: 1;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn--lg { font-size: 16px; padding: 15px 26px; }
.btn > svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #000; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(11,11,12,.18); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-1px); }
/* arrow nudge — the icon macro emits the arrow as svg.i-arrow; nudge on any button */
.btn .i-arrow { transition: transform .18s ease; }
.btn:hover .i-arrow { transform: translateX(3px); }

/* keyboard focus ring — outline follows each element's own border-radius */
:where(a, button, .btn, .scard, .nav__toggle):focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 30px; width: auto; display: block; }

.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links > a:not(.btn) { font-size: 15px; color: var(--ink-soft); font-weight: 500; transition: color .18s ease; }
.nav__links > a:not(.btn):hover { color: var(--ink); }
.nav__login { padding: 10px 18px; font-size: 14.5px; }
.nav__cta { margin-left: 4px; }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav__toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__mobile { display: none; flex-direction: column; gap: 4px; padding: 8px var(--gut) 22px; border-bottom: 1px solid var(--line); background: #fff; }
.nav__mobile a:not(.btn) { padding: 12px 4px; font-size: 17px; font-weight: 500; border-bottom: 1px solid var(--line); }
.nav__mobile .btn { margin-top: 12px; justify-content: center; }

/* ---------- hero ---------- */
.hero {
  padding: clamp(48px, 8vw, 110px) 0 clamp(40px, 6vw, 80px); overflow: hidden;
  background: radial-gradient(42% 50% at 92% 0%, rgba(176,141,87,.10), transparent 66%);
}
.hero__grid { text-align: center; }
.hero__copy { max-width: 760px; margin-inline: auto; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-text); margin-bottom: 22px;
}
.hero__title { font-size: clamp(38px, 5.6vw, 68px); font-weight: 800; }
.hero__title-accent { color: var(--gold); }
.hero__sub {
  margin-top: 26px; max-width: 540px; margin-inline: auto;
  font-size: clamp(16px, 1.4vw, 19px); color: var(--muted); line-height: 1.65;
}
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 36px; }

.trustline { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 22px; margin-top: 34px; }
.trustline__item { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft); letter-spacing: .01em; }
.trustline__item svg { width: 16px; height: 16px; color: var(--gold-deep); flex: 0 0 auto; }

/* ---------- services grid (icon-top outcome cards; mobile-first, see min-width tiers) ---------- */
.services__grid {
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
.scard {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 13px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; height: 100%;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.scard:hover { transform: translateY(-3px); border-color: #dcdcdc; box-shadow: var(--shadow-md); }
.scard__icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.scard__icon svg { width: 24px; height: 24px; }
.scard:hover .scard__icon { background: var(--gold-soft); color: var(--gold-deep); border-color: transparent; }
.scard__label { font-weight: 700; font-size: 16px; letter-spacing: -0.015em; }
.scard__desc { font-size: 14px; color: var(--muted); line-height: 1.55; }
.scard__go { position: absolute; top: 22px; right: 22px; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .2s ease, transform .2s ease; }
.scard:hover .scard__go { opacity: 1; transform: none; color: var(--gold-deep); }

/* ---------- contact ---------- */
.contact { padding: clamp(48px, 7vw, 96px) 0; border-top: 1px solid var(--line); }
.contact__grid {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.contact__title { font-size: clamp(26px, 3.2vw, 40px); margin-top: 4px; }
.contact__lead { margin-top: 16px; max-width: 440px; font-size: 17px; color: var(--muted); }
.contact__details { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.contact__details li { display: flex; align-items: center; gap: 12px; font-size: 15.5px; color: var(--ink-soft); }
.contact__details a:hover { color: var(--gold-deep); }
.contact__ico {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; color: var(--gold-deep);
  background: var(--gold-soft); border: 1px solid transparent;
}

.contact__card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: clamp(22px, 3vw, 34px);
}

.cform { display: flex; flex-direction: column; gap: 18px; }
.cform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: -0.01em; }
.field__opt { font-weight: 400; color: var(--ink-faint, var(--ink-soft)); }
.field__input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field__input::placeholder { color: #a6a6ad; }
.field__input:hover { border-color: #dcdcdc; }
.field__input:focus {
  outline: none; background: #fff; border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(148,115,63,.22);
}
textarea.field__input { resize: vertical; min-height: 120px; line-height: 1.55; }

.cform__submit { justify-content: center; margin-top: 4px; }
.cform__fine { font-size: 12.5px; color: var(--muted); text-align: center; }

/* honeypot — visually removed, kept in the accessibility tree out of tab order */
.cform__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.flash {
  font-size: 14.5px; font-weight: 500; padding: 13px 16px; border-radius: var(--radius-sm);
  margin-bottom: 18px; border: 1px solid transparent;
}
.flash--success { color: #1d6b3f; background: #eaf6ef; border-color: #c9e7d5; }
.flash--error { color: #8a2b2b; background: #fbecec; border-color: #f1cfcf; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 48px 0 36px; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; justify-content: space-between; }
.footer__brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer__logo { height: 40px; width: auto; display: block; }
.footer__tag { width: 100%; margin-top: 6px; color: var(--muted); font-size: 14px; }
/* footer__contact / footer__social live in the homepage-components block below */
.footer__legal {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13.5px;
}

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .nav__mobile.is-open { display: flex; }
  .hero { padding-top: 40px; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .footer__legal { flex-direction: column; gap: 6px; }
  .cform__row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .001ms !important; animation-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .btn--primary:hover, .btn--ghost:hover, .btn--whatsapp:hover,
  .pain:hover, .aud:hover, .scard:hover, .footer__social a:hover { transform: none !important; }
}

/* =========================================================================
   HOMEPAGE COMPONENTS — premium marketing sections
   Mobile-first; reuses the tokens above. No portal/dashboard UI.
   ========================================================================= */

/* shared section shell + heads */
.sec { padding: clamp(56px, 8vw, 104px) 0; }
/* keep anchored sections clear of the sticky nav when jumped to */
section[id], .contact[id] { scroll-margin-top: 90px; }
.sec--grey { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec__head { max-width: 680px; margin-bottom: clamp(32px, 5vw, 56px); }
.sec__head--center { margin-inline: auto; text-align: center; }
.sec__title { font-size: clamp(26px, 3.4vw, 42px); }
.sec__lead { margin-top: 16px; font-size: clamp(16px, 1.4vw, 18px); color: var(--muted); line-height: 1.65; }

/* credibility strip — icon + label + sub, divided */
.cred { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 26px 0; }
.cred__row { display: grid; grid-template-columns: 1fr; gap: 18px; }
.cred__item { display: flex; align-items: center; gap: 14px; }
.cred__ico { flex: 0 0 auto; color: var(--ink); display: inline-flex; }
.cred__ico svg { width: 28px; height: 28px; }
.cred__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cred__label { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; line-height: 1.25; }
.cred__sub { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
@media (min-width: 680px) {
  .cred__row { grid-template-columns: repeat(2, 1fr); gap: 22px 34px; }
}
@media (min-width: 940px) {
  .cred__row { grid-template-columns: repeat(4, 1fr); gap: 0; }
  .cred__item { padding: 2px 30px; }
  .cred__item:first-child { padding-left: 0; }
  .cred__item:last-child { padding-right: 0; }
  .cred__item:not(:first-child) { border-left: 1px solid var(--line); }
}

/* problem — pain cards */
.pains { display: grid; grid-template-columns: 1fr; gap: 14px; }
.pain {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pain:hover { transform: translateY(-3px); border-color: #dcdcdc; box-shadow: var(--shadow-md); }
.pain__icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.pain__icon svg { width: 24px; height: 24px; }
.pain:hover .pain__icon { background: var(--gold-soft); color: var(--gold-deep); border-color: transparent; }
.pain__body { flex: 1; min-width: 0; }
.pain__title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.pain__text { margin-top: 6px; font-size: 14.5px; color: var(--muted); line-height: 1.6; }

/* solution — value band (left heading + benefit list) */
.value__grid { display: grid; grid-template-columns: 1fr; gap: clamp(34px, 5vw, 60px); align-items: start; }
.value__head { max-width: 480px; }
.value__head .sec__title { margin-top: 14px; }
.value__items { display: grid; gap: 22px; }
.value__item { display: flex; align-items: flex-start; gap: 16px; }
.value__ico {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; color: var(--gold-deep);
  background: var(--gold-soft); border: 1px solid transparent;
}
.value__ico svg { width: 25px; height: 25px; }
.value__body { min-width: 0; }
.value__title { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.value__text { margin-top: 5px; font-size: 14.5px; color: var(--muted); line-height: 1.6; }
@media (min-width: 880px) {
  .value__grid { grid-template-columns: 0.92fr 1.08fr; gap: clamp(48px, 6vw, 88px); }
  .value__items { gap: 26px; }
}

/* who we help — audience cards */
.audiences { display: grid; grid-template-columns: 1fr; gap: 12px; }
.aud {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.aud:hover { transform: translateY(-2px); border-color: #dcdcdc; box-shadow: var(--shadow-md); }
.aud__icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.aud__icon svg { width: 22px; height: 22px; }
.aud:hover .aud__icon { background: var(--gold-soft); color: var(--gold-deep); border-color: transparent; }
.aud__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aud__label { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.aud__note { font-size: 13px; color: var(--muted); line-height: 1.4; }

/* process — numbered timeline (vertical rail on mobile, horizontal on desktop) */
.process { display: grid; grid-template-columns: 1fr; gap: 0; }
.pstep { position: relative; display: flex; gap: 18px; padding-bottom: 34px; }
.pstep:last-child { padding-bottom: 0; }
.pstep::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 6px; width: 2px; background: var(--line); }
.pstep:last-child::before { display: none; }
.pstep__node {
  position: relative; z-index: 1; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--gold-text);
  background: var(--gold-soft); border: 1px solid var(--line);
}
.pstep__body { padding-top: 6px; }
.pstep__title { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
.pstep__ico { display: inline-flex; color: var(--gold-deep); }
.pstep__ico svg { width: 18px; height: 18px; }
.pstep__text { margin-top: 6px; font-size: 14.5px; color: var(--muted); line-height: 1.6; }

/* trust — stats + credentials */
.trust__grid { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 4vw, 48px); align-items: center; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stat { background: #fff; padding: 24px 18px; text-align: center; }
.stat__num { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; color: var(--gold-deep); line-height: 1; }
.stat__label { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.creds { display: flex; flex-direction: column; gap: 14px; }
.creds__item { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--ink-soft); }
.creds__ico { flex: 0 0 auto; color: var(--gold-deep); margin-top: 1px; display: inline-flex; }
.creds__ico svg { width: 20px; height: 20px; }

/* final CTA band */
.fcta { padding: clamp(56px, 8vw, 104px) 0; }
.fcta__inner {
  position: relative; overflow: hidden;
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 80px); text-align: center;
}
.fcta__inner::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(50% 70% at 50% 0%, rgba(176,141,87,.25), transparent 60%); }
.fcta__title { position: relative; font-size: clamp(26px, 3.6vw, 46px); }
.fcta__sub { position: relative; max-width: 560px; margin: 18px auto 32px; color: #c9c9cd; font-size: 17px; line-height: 1.6; }
.fcta__actions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.fcta .btn--primary { background: #fff; color: var(--ink); }
.fcta .btn--primary:hover { background: var(--gold-soft); }
.fcta .btn--ghost { color: #fff; border-color: rgba(255,255,255,.28); }
.fcta .btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.06); }

/* WhatsApp button */
.btn--whatsapp { background: #fff; color: var(--ink-soft); border: 1px solid var(--line); }
.btn--whatsapp:hover { border-color: var(--gold); color: var(--gold-deep); background: var(--gold-soft); transform: translateY(-1px); }
.btn--whatsapp svg { width: 18px; height: 18px; }
.whatsapp-line { display: flex; justify-content: center; margin-top: 18px; }

/* homepage responsive (progressive, mobile-up) */
@media (min-width: 620px) {
  .pains { grid-template-columns: repeat(2, 1fr); }
  .audiences { grid-template-columns: repeat(2, 1fr); }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 760px) {
  .trust__grid { grid-template-columns: 1.1fr 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .process { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .pstep { flex-direction: column; gap: 16px; padding: 0 6px; }
  .pstep::before { left: 40px; right: -8px; top: 19px; bottom: auto; width: auto; height: 2px; }
  .pstep:last-child::before { display: none; }
  .pstep__body { padding-top: 0; }
}
@media (min-width: 960px) {
  .pains { grid-template-columns: repeat(3, 1fr); }
  .audiences { grid-template-columns: repeat(3, 1fr); }
  .services__grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1100px) {
  .audiences { grid-template-columns: repeat(4, 1fr); }
}

/* footer additions */
.footer__contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--muted); font-size: 15px; }
.footer__contact a:hover { color: var(--ink); }
.footer__social { display: flex; gap: 10px; }
.footer__social a {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line);
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.footer__social a:hover { color: var(--gold-deep); border-color: var(--gold); background: var(--gold-soft); transform: translateY(-1px); }
.footer__social svg { width: 19px; height: 19px; }

/* =========================================================================
   PORTAL / APP UI — authenticated /app + /auth (reuses the tokens above)
   ========================================================================= */

/* ---- auth (login / standalone) ---- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(60% 50% at 50% 0%, var(--gold-soft), transparent 70%), var(--surface);
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: clamp(26px, 4vw, 40px); text-align: center;
}
.auth-logo { display: inline-block; margin-bottom: 22px; }
.auth-logo img { height: 32px; width: auto; }
.auth-title { font-size: 24px; font-weight: 800; }
.auth-sub { margin-top: 6px; color: var(--muted); font-size: 15px; margin-bottom: 22px; }
.auth-card .cform { text-align: left; }
.auth-remember { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-soft); }
.auth-remember input { width: 16px; height: 16px; accent-color: var(--gold-deep); }
.auth-foot { margin-top: 20px; font-size: 14px; }
.auth-foot a { color: var(--muted); }
.auth-foot a:hover { color: var(--ink); }

/* form field error + select + checkbox (portal forms) */
.field__err { display: block; font-size: 12.5px; color: #8a2b2b; margin-top: 2px; }
.field__select { cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink-soft); }
.check input { width: 17px; height: 17px; accent-color: var(--gold-deep); }

/* ---- app shell ---- */
.app-body { background: var(--surface); }
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.app-sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; padding: 22px 16px;
  background: #fff; border-right: 1px solid var(--line);
}
.app-brand { display: block; padding: 4px 8px 18px; }
.app-brand img { height: 28px; width: auto; }
.app-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.app-nav__group {
  margin: 16px 10px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.app-nav__link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.app-nav__link:hover { background: var(--surface); color: var(--ink); }
.app-nav__link.is-active { background: var(--gold-soft); color: var(--gold-text); font-weight: 600; }
.app-nav__ico { display: inline-flex; flex: 0 0 auto; }
.app-nav__ico svg { width: 19px; height: 19px; }
.app-sidebar__foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }

.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: rgba(255, 255, 255, .85); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-burger { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink); }
.app-burger svg { width: 24px; height: 24px; }

.app-switcher { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.app-switcher__label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.app-switcher__select { position: relative; display: inline-flex; align-items: center; }
.app-switcher__select select {
  appearance: none; -webkit-appearance: none; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 600; color: var(--ink);
  padding: 8px 34px 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.app-switcher__select svg { position: absolute; right: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.app-switcher__single { font-size: 14px; font-weight: 600; color: var(--ink-soft); }

.app-user { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.app-user__meta { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.app-user__name { font-size: 14px; font-weight: 600; }
.app-user__role { font-size: 12px; color: var(--muted); }
.app-user__link { font-size: 13.5px; color: var(--muted); }
.app-user__link:hover { color: var(--ink); }
.app-user__logout { margin: 0; }
.btn.app-logout { padding: 9px 14px; font-size: 13.5px; }
.btn.app-logout svg { width: 16px; height: 16px; }

.app-content { padding: clamp(20px, 3vw, 36px); width: 100%; max-width: 1120px; }
.app-flashes { margin-bottom: 18px; }
.app-page__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.app-h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; }
.app-page__head .app-sub { margin-top: 4px; }

.app-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: clamp(20px, 3vw, 28px); }
.app-card--narrow { max-width: 560px; }
.app-card--flush { padding: 0; overflow: hidden; }
.app-note {
  margin-top: 22px; padding: 16px 18px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--gold-soft); color: var(--ink-soft); font-size: 14.5px;
}
.app-link { color: var(--gold-text); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.app-link:hover { color: var(--gold-deep); }
.app-link svg { width: 16px; height: 16px; }
.muted { color: var(--muted); }

/* stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px) { .stat-cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.stat-card__num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.stat-card__label { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* data table */
.app-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.app-table thead th {
  text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.app-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink-soft); vertical-align: middle; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table tbody tr:hover { background: var(--surface); }
.app-table__strong { font-weight: 600; color: var(--ink); }
.app-table__r { text-align: right; }

/* badges */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); white-space: nowrap;
}
.badge--ok { background: #eaf6ef; color: #1d6b3f; border-color: #c9e7d5; }
.badge--off { background: var(--surface-2); color: var(--muted); }
.badge--gold, .badge--role { background: var(--gold-soft); color: var(--gold-text); border-color: transparent; }

/* ---- portal responsive ---- */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; width: 264px; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .app-sidebar.is-open { transform: none; }
  .app-burger { display: inline-flex; }
}
@media (max-width: 560px) {
  .app-user__meta, .app-user__link { display: none; }
  .app-topbar { gap: 10px; padding: 10px 16px; }
  .app-switcher__label { display: none; }
  .app-content { padding: 18px 16px 40px; }
}

/* Tables collapse to stacked cards on phones — each row becomes a labelled
   card (labels come from each cell's data-label). Avoids horizontal overflow. */
@media (max-width: 720px) {
  .app-table thead {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0;
  }
  .app-table, .app-table tbody, .app-table tr, .app-table td { display: block; width: 100%; }
  .app-table tbody tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .app-table tbody tr:last-child { border-bottom: 0; }
  .app-table tbody tr:hover { background: transparent; }
  .app-table tbody td {
    display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 8px 16px;
    align-items: baseline; justify-items: end; padding: 5px 0; border: 0;
    text-align: right; color: var(--ink-soft); overflow-wrap: anywhere;
  }
  .app-table tbody td::before {
    content: attr(data-label); justify-self: start; text-align: left;
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--muted);
  }
  /* the name cell is the card title — no label, full width */
  .app-table tbody td.app-table__strong { display: block; text-align: left; font-size: 16px; padding: 0 0 6px; }
  .app-table tbody td.app-table__strong::before { content: none; }
  /* trailing action cell (View / Edit): right-aligned, no label */
  .app-table tbody td.app-table__r { display: block; text-align: right; padding-top: 10px; }
  .app-table tbody td.app-table__r::before { content: none; }
  /* empty cells (e.g. an action column with nothing) don't render a blank row */
  .app-table tbody td:empty { display: none; }
}

/* ---- leads / activities ---- */
.app-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.app-filters .field__input { width: auto; }
.app-search { flex: 1 1 220px; max-width: 360px; }
@media (max-width: 560px) {
  .app-filters { gap: 8px; }
  .app-filters .field__input, .app-filters .app-search, .app-filters .btn { flex: 1 1 100%; max-width: none; width: 100%; }
  .activity-add__row { grid-template-columns: 1fr; }
}
.app-actions { display: flex; align-items: center; gap: 10px; }
.app-actions form { margin: 0; }
.app-danger:hover { border-color: #c0392b; color: #c0392b; }
.app-rowlink { color: var(--ink); font-weight: 600; }
.app-rowlink:hover { color: var(--gold-deep); }
.app-h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.app-h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }

.badge--new { background: var(--surface-2); color: var(--ink-soft); }
.badge--inprog { background: var(--gold-soft); color: var(--gold-text); border-color: transparent; }
.badge--won { background: #eaf6ef; color: #1d6b3f; border-color: #c9e7d5; }
.badge--lost { background: var(--surface-2); color: var(--muted); }

.lead-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
@media (min-width: 860px) { .lead-grid { grid-template-columns: 0.85fr 1.15fr; } }

.kv { display: grid; grid-template-columns: 104px 1fr; gap: 12px 14px; align-items: center; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { color: var(--ink-soft); min-width: 0; }
.kv form { margin: 0; }
.kv-status { width: auto; min-width: 140px; max-width: 100%; padding: 7px 12px; }
.lead-notes { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-soft); white-space: pre-wrap; }

.activity-add { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.activity-add__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.activity-add .btn { align-self: flex-start; }

.timeline { display: flex; flex-direction: column; }
.timeline__item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.timeline__item:last-child { border-bottom: 0; }
.timeline__empty { padding: 14px 0; }
.timeline__head { display: flex; align-items: center; gap: 10px; }
.timeline__type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gold-text); }
.timeline__body { margin-top: 6px; font-size: 14.5px; color: var(--ink-soft); white-space: pre-wrap; }
.timeline__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.timeline__meta form { margin: 0; }
.timeline__due { font-weight: 600; color: var(--gold-deep); }

/* ---- customers / contacts ---- */
.app-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.app-card__head .app-h2 { margin-bottom: 0; }
.btn--sm { padding: 7px 12px; font-size: 13px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.contact-list { display: flex; flex-direction: column; }
.contact-card { padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-card:last-child { border-bottom: 0; }
.contact-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.contact-card__name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.contact-card__role { margin-top: 3px; font-size: 13px; color: var(--muted); }
.contact-card__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.contact-card__actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.contact-card__actions form { margin: 0; }
.contact-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; }

/* ---- operations / tickets ---- */
/* status + priority badges */
.badge--wait { background: #fbeecf; color: #8a5a16; border-color: transparent; }
.badge--urgent { background: #fdeaea; color: #b4231f; border-color: #f3c9c7; }
.badge--high { background: var(--gold-soft); color: var(--gold-text); border-color: transparent; }
.badge--normal { background: var(--surface-2); color: var(--ink-soft); }
.badge--low { background: var(--surface-2); color: var(--muted); }

.tref { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 6px; }
.tref--lg { color: var(--gold-deep); margin: 0 4px 0 0; }
.due-over { color: #b4231f; font-weight: 600; }
.check--inline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; margin: 0; }

/* kanban board */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.kanban__col { flex: 0 0 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.kanban__col.is-over { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.kanban__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 10px; }
.kanban__title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kanban__count { font-size: 12px; font-weight: 700; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; }
.kanban__list { display: flex; flex-direction: column; gap: 10px; min-height: 44px; }

.tcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: grab; box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.04)); }
.tcard:active { cursor: grabbing; }
.tcard.is-dragging { opacity: .45; }
.tcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.tcard__ref { font-size: 12px; font-weight: 700; color: var(--muted); }
.tcard__title { display: block; font-weight: 600; font-size: 14px; color: var(--ink); line-height: 1.35; }
.tcard__title:hover { color: var(--gold-deep); }
.tcard__meta { display: flex; flex-direction: column; gap: 4px; margin-top: 9px; font-size: 12px; color: var(--ink-soft); }
.tcard__meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.tcard__meta svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--muted); }
.tcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.tcard__due.is-overdue { color: #b4231f; font-weight: 600; }

/* ticket audit timeline */
.timeline__item--event { display: flex; gap: 12px; }
.tl-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.tl-dot.is-created { background: var(--ink); }
.tl-dot.is-note { background: var(--gold); }
.tl-dot.is-status { background: #6b8bd6; }
.tl-dot.is-assigned { background: #7a5cc0; }
.tl-dot.is-priority { background: #d98a2b; }
.tl-dot.is-done { background: #1d6b3f; }
.tl-body { flex: 1 1 auto; min-width: 0; }
.tl-change { font-size: 13.5px; color: var(--ink-soft); }

@media (max-width: 560px) { .kanban__col { flex-basis: 84vw; } }

/* ticket detail sub-panels: tasks / time / watchers / attachments */
.ops-panels { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; align-items: start; }
@media (min-width: 860px) { .ops-panels { grid-template-columns: 1fr 1fr; } }
.ops-panel .app-card__head { margin-bottom: 12px; }
.note-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 2px 0 2px; }
.note-opts .is-muted { color: var(--muted); }
.field__file { padding: 7px 10px; font-size: 13px; }

.panel-add { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.panel-add__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel-add__row .field__input { flex: 1 1 120px; width: auto; }
.panel-add__row .btn { flex: 0 0 auto; }

.task-list, .time-list, .watcher-list, .attach-list { display: flex; flex-direction: column; }
.panel-empty { padding: 10px 0; }
.task-item, .time-item, .watcher-item, .attach-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task-item:last-child, .time-item:last-child, .watcher-item:last-child, .attach-item:last-child { border-bottom: 0; }
.task-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-desc { font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.task-meta { font-size: 12px; color: var(--muted); }
.task-item.is-done .task-desc { text-decoration: line-through; color: var(--muted); }

.task-check { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; display: grid; place-items: center; color: #1d6b3f; padding: 0; }
.task-check:hover { border-color: var(--gold); }
.task-check svg { width: 14px; height: 14px; }
.task-item.is-done .task-check { background: #eaf6ef; border-color: #c9e7d5; }

.panel-del { flex: 0 0 auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 4px; border-radius: 6px; }
.panel-del:hover { color: #b4231f; background: #fdeaea; }
.panel-add__row .check--inline { flex: 0 0 auto; }

.time-amt { flex: 0 0 auto; font-weight: 700; font-size: 13px; color: var(--ink); min-width: 52px; display: inline-flex; align-items: center; gap: 5px; }
.time-bill { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-text); font-size: 10px; font-weight: 700; }
.watcher-item, .attach-item { align-items: center; justify-content: space-between; }
.watcher-item > span:first-child, .attach-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.watcher-item svg, .attach-name svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted); }
.attach-item { flex-wrap: wrap; gap: 4px 10px; }
.attach-name { flex: 1 1 200px; overflow-wrap: anywhere; }

/* ---- email templates / lead email ---- */
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.field-hint code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; color: var(--gold-text); }
.field__input.code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; line-height: 1.5; }
.delete-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.email-to { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.lead-emails { margin-top: 18px; }
.email-list { display: flex; flex-direction: column; }
.email-list__item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.email-list__item:last-child { border-bottom: 0; }
.email-list__main { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.email-list__subject { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.email-list__meta { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.email-err { color: #8a2b2b; }
.test-send { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.test-send__form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.test-send__form input { max-width: 280px; }
.tpl-edit-grid { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.tpl-edit-grid .tpl-edit-main { flex: 1 1 460px; margin: 0; max-width: 660px; }
.tpl-debug { flex: 1 1 320px; max-width: 440px; margin: 0; }
.tpl-debug__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tpl-debug__head h3 { margin: 0; }
.tpl-debug__status { font-weight: 600; font-size: 13.5px; margin: 4px 0 10px; color: var(--muted); }
.tpl-debug__status.is-ok { color: #1f7a3d; }
.tpl-debug__status.is-err { color: #8a2b2b; }
.tpl-debug__log { background: #0f1115; color: #d8e3c4; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.55; padding: 12px 14px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto; margin: 0; }


/* =========================================================================
   HELP CENTRE — public knowledge base (/help). Reuses the design tokens.
   ========================================================================= */

/* hero + search */
.help-hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: clamp(48px, 8vw, 92px) 0 clamp(36px, 6vw, 64px);
  text-align: center;
}
.help-hero__inner { max-width: 760px; margin: 0 auto; }
.help-hero__title { font-size: clamp(30px, 5vw, 46px); margin: 10px 0 8px; }
.help-hero__sub { color: var(--muted); font-size: clamp(15px, 2.2vw, 18px); }

.help-search {
  position: relative; display: flex; align-items: center;
  margin: clamp(22px, 4vw, 32px) auto 0; max-width: 620px;
}
.help-search__ico {
  position: absolute; left: 18px; color: var(--gold-deep);
  display: inline-flex; pointer-events: none;
}
.help-search__ico svg { width: 22px; height: 22px; }
.help-search__input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  padding: 16px 18px 16px 52px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow-md);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.help-search__input:focus { outline: none; border-color: var(--gold); box-shadow: var(--shadow-lg); }
.help-search__input::placeholder { color: var(--muted); }
.help-search--inline { margin-top: 8px; box-shadow: none; }
.help-search--inline .help-search__input { box-shadow: var(--shadow-sm); }
.help-search__meta { color: var(--muted); font-size: 14px; margin: 16px 0 4px; }

.help-main { padding: clamp(32px, 6vw, 56px) 0 clamp(48px, 8vw, 88px); }
.help-section { margin-bottom: clamp(34px, 6vw, 56px); }
.help-section__title { font-size: clamp(19px, 2.6vw, 24px); margin-bottom: 18px; }

/* category cards */
.help-cat-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}
.help-cat {
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.help-cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold); }
.help-cat__ico {
  display: inline-flex; width: 44px; height: 44px; margin-bottom: 6px;
  align-items: center; justify-content: center; border-radius: 12px;
  background: var(--gold-soft); color: var(--gold-deep);
}
.help-cat__ico svg { width: 24px; height: 24px; }
.help-cat__name { font-weight: 700; font-size: 17px; }
.help-cat__desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.help-cat__count { margin-top: auto; padding-top: 8px; color: var(--gold-text); font-size: 12.5px; font-weight: 600; }

/* FAQ accordion (Popular questions) */
.help-faq { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.help-faq__item { border-bottom: 1px solid var(--line); }
.help-faq__item:last-child { border-bottom: 0; }
.help-faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 20px; cursor: pointer; font-weight: 600; font-size: 16px;
  list-style: none; color: var(--ink);
}
.help-faq__q::-webkit-details-marker { display: none; }
.help-faq__q:hover { color: var(--gold-deep); }
.help-faq__chev { color: var(--muted); display: inline-flex; transition: transform .2s ease; }
.help-faq__chev svg { width: 20px; height: 20px; }
.help-faq__item[open] .help-faq__chev { transform: rotate(180deg); }
.help-faq__a { padding: 0 20px 20px; }
.help-faq__lead { color: var(--ink-soft); margin-bottom: 10px; }

/* live + server search results */
.help-result-list { display: flex; flex-direction: column; gap: 10px; }
.help-result a {
  display: block; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.help-result a:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.help-result__cat { display: block; font-size: 12px; font-weight: 600; color: var(--gold-text); text-transform: uppercase; letter-spacing: .04em; }
.help-result__title { display: block; font-weight: 700; font-size: 16px; margin: 3px 0; }
.help-result__sum { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }
.help-result mark { background: var(--gold-soft); color: var(--gold-text); padding: 0 2px; border-radius: 3px; }

.help-empty { color: var(--muted); padding: 18px 2px; }
.help-empty a, .help-link { color: var(--gold-text); font-weight: 600; }
.help-empty a:hover, .help-link:hover { color: var(--gold-deep); text-decoration: underline; }
.help-link { display: inline-flex; align-items: center; gap: 6px; }
.help-link svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* article + category reading pages */
.help-article-wrap { max-width: 820px; padding-top: clamp(26px, 4vw, 44px); padding-bottom: clamp(40px, 7vw, 80px); }
.help-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.help-breadcrumb a { color: var(--gold-text); font-weight: 600; }
.help-breadcrumb a:hover { color: var(--gold-deep); }

.help-cat-head { margin-bottom: 26px; }
.help-cat-head__ico {
  display: inline-flex; width: 52px; height: 52px; margin-bottom: 12px;
  align-items: center; justify-content: center; border-radius: 14px;
  background: var(--gold-soft); color: var(--gold-deep);
}
.help-cat-head__ico svg { width: 28px; height: 28px; }
.help-cat-head__title { font-size: clamp(26px, 4vw, 36px); }
.help-cat-head__sub { color: var(--muted); font-size: 16px; margin-top: 8px; max-width: 60ch; }

.help-article-list { display: flex; flex-direction: column; gap: 12px; }
.help-article-link {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.help-article-link:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.help-article-link__ico { color: var(--gold-deep); display: inline-flex; flex: 0 0 auto; }
.help-article-link__ico svg { width: 22px; height: 22px; }
.help-article-link__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.help-article-link__title { font-weight: 600; font-size: 16px; }
.help-article-link__sum { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.help-article-link__chev { margin-left: auto; color: var(--muted); display: inline-flex; flex: 0 0 auto; }
.help-article-link__chev svg { width: 18px; height: 18px; }

.help-article__head { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.help-article__title { font-size: clamp(28px, 4.4vw, 40px); }
.help-article__lead { color: var(--ink-soft); font-size: clamp(16px, 2.2vw, 19px); margin-top: 12px; line-height: 1.5; }

/* article body typography */
.help-prose { color: var(--ink-soft); font-size: 16.5px; line-height: 1.75; }
.help-prose > * + * { margin-top: 1.1em; }
.help-prose h2 { font-size: clamp(21px, 3vw, 27px); margin-top: 1.7em; color: var(--ink); }
.help-prose h3 { font-size: clamp(18px, 2.4vw, 21px); margin-top: 1.4em; color: var(--ink); }
.help-prose a { color: var(--gold-text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.help-prose a:hover { color: var(--gold-deep); }
.help-prose strong { color: var(--ink); }
.help-prose ul, .help-prose ol { padding-left: 1.4em; }
.help-prose li { margin: 0.4em 0; }
.help-prose ul { list-style: disc; }
.help-prose ol { list-style: decimal; }
.help-prose img { border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 1.2em 0; box-shadow: var(--shadow-sm); }
.help-prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; color: var(--gold-text); }
.help-prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.2em 0; }
.help-prose th, .help-prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.help-prose th { font-weight: 700; color: var(--ink); background: var(--surface); }
.help-prose blockquote { border-left: 3px solid var(--gold); padding-left: 16px; color: var(--muted); font-style: italic; }
/* numbered step list */
.help-prose ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
.help-prose ol.steps > li { position: relative; padding: 2px 0 2px 48px; margin: 0.9em 0; counter-increment: step; }
.help-prose ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; border-radius: 50%; font-weight: 700; font-size: 14px;
}
/* callout / tip box */
.help-prose .callout {
  background: var(--gold-soft); border: 1px solid transparent; border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm); padding: 14px 18px; color: var(--ink-soft);
}
.help-prose .callout > * + * { margin-top: 0.6em; }

.help-related { margin-top: clamp(32px, 5vw, 48px); }

/* contact CTA */
.help-cta { margin-top: clamp(32px, 5vw, 52px); }
.help-cta__inner {
  text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 44px);
}
.help-cta__title { font-size: clamp(20px, 3vw, 26px); }
.help-cta__sub { color: var(--muted); margin: 8px 0 18px; }
.help-cta__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.help-back { margin-top: 26px; }

/* admin (portal) help list extras */
.help-admin-cat { margin-bottom: 18px; }
.help-admin-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-admin-cat__head .app-nav__ico { vertical-align: middle; color: var(--gold-deep); }
.help-format-help { margin: -2px 0 6px; }
.help-format-help summary { cursor: pointer; font-size: 13px; color: var(--gold-text); font-weight: 600; }
.help-format-help__list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }


/* =========================================================================
   TICKET DETAIL — team members + unified Add activity card
   ========================================================================= */

/* Team members in the Details card */
.kv-team { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.kv-team .app-h3 { margin-bottom: 10px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; }
.member-chip__ico { display: inline-flex; color: var(--gold-deep); }
.member-chip__ico svg { width: 16px; height: 16px; }
.member-chip form { margin: 0; display: inline-flex; }
.member-chip__x { border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 3px 4px; border-radius: 50%; }
.member-chip__x:hover { background: var(--surface-2); color: var(--ink); }
.member-empty { font-size: 13px; margin-bottom: 12px; }
.member-add { display: flex; gap: 8px; align-items: center; }
.member-add .field__select { flex: 1 1 auto; min-width: 0; }

/* Add activity card */
.activity-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.field--xs { flex: 1 1 110px; min-width: 96px; gap: 4px; }
.field--xs .field__label { font-size: 11.5px; }
.act-total { display: inline-flex; align-items: center; min-height: 38px; font-weight: 700;
  font-size: 15px; color: var(--ink); }
.act-total.is-bad { color: #8a2b2b; font-weight: 600; font-size: 13px; }
.activity-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 12px 0; }
.act-attach { position: relative; overflow: hidden; cursor: pointer; gap: 6px; }
.act-attach svg { width: 16px; height: 16px; }
.act-files { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.act-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.act-prev { position: relative; width: 72px; height: 72px; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; background: var(--surface); }
.act-prev img { width: 100%; height: 100%; object-fit: cover; }
.act-prev--file { display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 10.5px; color: var(--muted); padding: 6px; word-break: break-word; }
.act-prev__x { position: absolute; top: 2px; right: 2px; border: 0; cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%; background: rgba(11,11,12,.7); color: #fff;
  font-size: 10px; line-height: 1; }

/* Timeline: time badge + inline attachments */
.tl-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  padding: 2px 9px; background: var(--gold-soft); color: var(--gold-text);
  border-radius: 999px; font-size: 12px; font-weight: 600; }
.tl-badge svg { width: 14px; height: 14px; }
.tl-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tl-img { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  max-width: 220px; box-shadow: var(--shadow-sm); }
.tl-img img { display: block; max-width: 100%; height: auto; max-height: 200px; object-fit: cover; }
.tl-file { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.tl-file svg { width: 16px; height: 16px; }
