/*
 * PointZero theme — main stylesheet.
 *
 * Replicates the visual system from the Replit Vite/Tailwind site as vanilla CSS.
 * Design tokens come straight from src/index.css of the original project.
 */

/* ---------- Design tokens ---------- */
:root {
  --app-font-sans: 'Poppins', system-ui, -apple-system, sans-serif;

  --background: #ffffff;
  --foreground: #111111;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --ring: #b72525;

  --card: #f4f4f5;
  --card-foreground: #111111;
  --card-border: #e5e5e5;

  --primary: #b72525;
  --primary-foreground: #ffffff;
  --primary-border: #a02020;

  --secondary: #d82a2a;
  --secondary-foreground: #ffffff;

  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --muted-border: #e5e5e5;

  --accent: #f4f4f5;
  --accent-foreground: #111111;

  --destructive: #ef4444;
  --destructive-foreground: #ffffff;

  --radius: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;

  --container-max: 80rem;
  --container-narrow: 56rem;
}

:root[lang="ar"] { --app-font-sans: 'Noto Naskh Arabic', system-ui, serif; }

.dark {
  --background: #000000;
  --foreground: #F0F0F0;
  --border: #27272a;
  --input: #27272a;
  --card: #1A1A1A;
  --card-foreground: #F0F0F0;
  --card-border: #27272a;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --muted-border: #3f3f46;
  --accent: #27272a;
  --accent-foreground: #F0F0F0;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--app-font-sans);
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  transition: background-color .3s, color .3s;
}
img, svg { display: block; max-width: 100%; height: auto; }
img { loading: lazy; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { padding: 0; margin: 0; list-style: none; }
input, textarea, select {
  font: inherit;
  color: inherit;
}

/* Skip link */
.pz-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
}
.pz-skip-link:focus { left: 0; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px);
  -webkit-clip-path: inset(50%); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px; word-wrap: normal !important;
}

/* ---------- Layout primitives ---------- */
.pz-app { display: flex; flex-direction: column; min-height: 100vh; background: var(--background); }
.pz-main { flex: 1 1 auto; outline: none; }
.pz-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) { .pz-container { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .pz-container { padding-left: 2rem; padding-right: 2rem; } }
.pz-container--narrow { max-width: var(--container-narrow); }

/* ---------- Theme-aware logo ---------- */
.pz-logo { display: inline-flex; align-items: center; }
.pz-logo__img { height: 32px; width: auto; }
.pz-logo--sm .pz-logo__img { height: 28px; }
.pz-logo__img--dark { display: none; }
.dark .pz-logo__img--light { display: none; }
.dark .pz-logo__img--dark { display: block; }

/* ---------- Navbar ---------- */
.pz-navbar {
  position: sticky; top: 0; z-index: 50;
  width: 100%;
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.pz-navbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 4rem;
}
.pz-navbar__links--desktop { display: none; }
.pz-navbar__actions--desktop { display: none; }
.pz-navbar__actions--mobile { display: flex; align-items: center; gap: 1rem; }
@media (min-width: 768px) {
  .pz-navbar__links--desktop, .pz-navbar__actions--desktop { display: flex; align-items: center; gap: 1.5rem; }
  .pz-navbar__actions--mobile { display: none; }
}

.pz-nav-list { display: flex; gap: 1.5rem; align-items: center; }
.pz-nav-link {
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color .2s;
}
.pz-nav-link:hover, .pz-nav-link--active { color: var(--primary); }

/* Buttons */
.pz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: .875rem;
  border: 1px solid transparent;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .15s;
  white-space: nowrap;
}
.pz-btn:active { transform: translateY(1px); }
.pz-btn--lg { padding: 1rem 2rem; font-size: 1.05rem; border-radius: .75rem; }
.pz-btn--block { width: 100%; }
.pz-btn--square { padding: .5rem; border-radius: var(--radius); }
.pz-btn--icon svg { flex-shrink: 0; }

.pz-btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 6px 20px -8px rgba(183,37,37,.45);
}
.pz-btn--primary:hover { background: var(--secondary); box-shadow: 0 8px 24px -6px rgba(183,37,37,.6); }

.pz-btn--ghost-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.2);
}
.pz-btn--ghost-light:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.4); }

.pz-btn--white { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 10px 30px -10px rgba(0,0,0,.3); }
.pz-btn--white:hover { background: #f3f4f6; }

.pz-btn--ghost-white {
  background: transparent; color: #fff; border-color: rgba(255,255,255,.4);
}
.pz-btn--ghost-white:hover { background: rgba(255,255,255,.15); }

.pz-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: var(--radius);
  transition: background-color .15s;
}
.pz-icon-btn:hover { background: var(--muted); }

.pz-link-toggle {
  font-size: .875rem; font-weight: 500; color: inherit;
  transition: color .15s;
}
.pz-link-toggle:hover { color: var(--primary); }
.pz-link-toggle--block { display: block; padding: .5rem 0; font-size: 1rem; }

/* Theme toggle: hide opposite icon */
.pz-icon-show-dark { display: none; }
.dark .pz-icon-show-light { display: none; }
.dark .pz-icon-show-dark { display: inline-flex; }

/* Mobile sheet */
.pz-mobile-sheet {
  position: fixed; inset: 0;
  z-index: 60;
}
.pz-mobile-sheet[hidden] { display: none; }
.pz-mobile-sheet__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
}
.pz-mobile-sheet__panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(320px, 85vw);
  background: var(--background);
  padding: 4rem 1.5rem 1.5rem;
  display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,.3);
}
[dir="rtl"] .pz-mobile-sheet__panel { left: auto; right: 0; }
.pz-mobile-sheet__close {
  position: absolute; top: 1rem; right: 1rem;
}
[dir="rtl"] .pz-mobile-sheet__close { right: auto; left: 1rem; }
.pz-mobile-nav-list { display: flex; flex-direction: column; gap: 1rem; }
.pz-mobile-nav-list .pz-nav-link { font-size: 1.125rem; color: var(--foreground); }
.pz-mobile-sheet__actions {
  margin-top: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ---------- Hero ---------- */
.pz-hero {
  position: relative;
  overflow: hidden;
  background: #000;
  color: #fff;
  min-height: 95vh;
  display: flex;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.pz-hero__inner { position: relative; z-index: 1; width: 100%; }
.pz-hero__bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pz-hero__glow {
  position: absolute;
  border-radius: 9999px;
  filter: blur(120px);
  background: rgba(183,37,37,.2);
}
.pz-hero__glow--a { top: 33%; left: 25%; width: 600px; height: 600px; }
.pz-hero__glow--b { bottom: 0; right: 33%; width: 400px; height: 400px; background: rgba(183,37,37,.08); }
.pz-hero__glow--c { left: 0; top: 50%; transform: translateY(-50%); width: 400px; height: 400px; background: rgba(183,37,37,.15); }
.pz-hero__glow--d { right: 0; bottom: 0; width: 500px; height: 500px; background: rgba(183,37,37,.08); }
.pz-hero__tilde {
  position: absolute;
  top: 2.5rem;
  right: -4rem;
  font-weight: 700;
  font-size: 30rem;
  line-height: 1;
  color: var(--primary);
  opacity: .1;
  user-select: none;
  pointer-events: none;
  animation: pz-float 7s ease-in-out infinite;
}
[dir="rtl"] .pz-hero__tilde { right: auto; left: -4rem; }
@keyframes pz-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

.pz-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem;
  border-radius: 9999px;
  background: rgba(183,37,37,.15);
  border: 1px solid rgba(183,37,37,.3);
  color: var(--primary);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: .08em;
}
.pz-badge__dot {
  width: .5rem; height: .5rem; border-radius: 9999px;
  background: var(--primary);
  animation: pz-pulse 2s ease-in-out infinite;
}
@keyframes pz-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.pz-hero__title {
  margin: 1.5rem 0;
  font-size: clamp(2.75rem, 7vw, 6rem);
  line-height: .95;
  font-weight: 700;
}
.pz-gradient-text {
  background-image: linear-gradient(135deg, #b72525 0%, #d82a2a 50%, #a02020 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.pz-hero__sub {
  margin: 0 0 2.5rem;
  max-width: 36rem;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: #9ca3af;
  line-height: 1.6;
}

.pz-cta-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.pz-cta-row--center { justify-content: center; }

.pz-hero__stats {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; flex-wrap: wrap; gap: 2rem;
}
.pz-stat { display: flex; align-items: center; gap: 1rem; }
.pz-stat__value { font-size: 2.25rem; font-weight: 700; color: var(--primary); }
.pz-stat__label { font-size: .875rem; color: #6b7280; max-width: 10rem; line-height: 1.3; }

/* ---------- Sections (light) ---------- */
.pz-section {
  position: relative;
  padding: 6rem 0;
  background: var(--background);
  overflow: hidden;
}
.pz-section--bg { background: var(--background); }
.pz-section--dark { background: #000; color: #fff; }
.pz-section--centered { text-align: center; }

.pz-section__header { margin-bottom: 4rem; }
.pz-section__header--center { text-align: center; }
.pz-eyebrow {
  color: var(--primary);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: .12em;
}
.pz-section__title {
  margin: .75rem 0 1rem;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
}
.pz-section__sub {
  margin: 0;
  font-size: 1.25rem;
  max-width: 36rem;
  color: var(--muted-foreground);
}
.pz-section__header--center .pz-section__sub { margin-left: auto; margin-right: auto; }
.pz-section__sub--dark { color: #9ca3af; max-width: 38rem; }

/* Step cards */
.pz-step-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 768px) { .pz-step-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pz-step-card {
  position: relative;
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(183,37,37,.15);
  transition: transform .3s, border-color .3s;
}
.pz-step-card:hover { transform: translateY(-8px); border-color: rgba(183,37,37,.5); }
.dark .pz-step-card { background: #0a0a0a; }
.pz-step-card__num {
  display: block;
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 1.5rem;
}
.pz-step-card__title { font-size: 1.5rem; margin-bottom: .75rem; }
.pz-step-card__desc { color: var(--muted-foreground); line-height: 1.6; }

/* Two-column layout (spotlight) */
.pz-two-col {
  display: grid;
  gap: 4rem;
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) { .pz-two-col { grid-template-columns: 1fr 1fr; } }
.pz-section--dark .pz-section__title { color: #fff; }

.pz-problem-list { display: flex; flex-direction: column; gap: 1rem; }
.pz-problem-card {
  display: flex; gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(6px);
  transition: border-color .2s;
}
.pz-problem-card:hover { border-color: rgba(183,37,37,.3); }
.pz-problem-card__icon {
  flex-shrink: 0;
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: rgba(183,37,37,.2);
  color: var(--primary);
}
.pz-problem-card__title { margin-bottom: .25rem; }
.pz-problem-card__desc { color: #9ca3af; font-size: .875rem; }

/* Signal tags */
.pz-signal-tags {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem;
  margin: 0 auto 3rem;
}
.pz-signal-tag {
  padding: .625rem 1.25rem;
  border-radius: 9999px;
  background: rgba(183,37,37,.1);
  color: var(--primary);
  border: 1px solid rgba(183,37,37,.2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  font-size: .875rem;
  transition: transform .2s, background-color .2s;
}
.pz-signal-tag:hover { transform: translateY(-2px) scale(1.05); background: rgba(183,37,37,.2); }

/* For-everyone columns */
.pz-col-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .pz-col-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.pz-col-card {
  padding: 2rem;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  transition: transform .3s, border-color .3s;
}
.pz-col-card:hover { transform: translateY(-4px); border-color: rgba(183,37,37,.3); }
.pz-col-card__icon {
  width: 3rem; height: 3rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: rgba(183,37,37,.2);
  color: var(--primary);
  margin-bottom: 1.25rem;
}
.pz-col-card__tag {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--primary);
}
.pz-col-card__title { font-size: 1.5rem; margin: .5rem 0 1.25rem; }
.pz-col-card__list { display: flex; flex-direction: column; gap: .75rem; color: #9ca3af; font-size: .875rem; }
.pz-col-card__list li { display: flex; align-items: center; gap: .75rem; }
.pz-bullet {
  width: .375rem; height: .375rem; border-radius: 9999px; background: var(--primary);
  flex-shrink: 0;
}

/* Final CTA */
.pz-final-cta {
  position: relative;
  overflow: hidden;
  padding: 8rem 0;
  background: var(--primary);
  color: #fff;
  text-align: center;
}
.pz-final-cta__bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 50%, #fff 1px, transparent 1px),
    radial-gradient(circle at 80% 50%, #fff 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: .1;
}
.pz-final-cta__tilde {
  position: absolute; top: 0; right: 0;
  font-size: 25rem; font-weight: 700; line-height: 1;
  color: rgba(255,255,255,.05);
  pointer-events: none; user-select: none;
}
.pz-final-cta__inner { position: relative; max-width: 56rem; margin: 0 auto; padding: 0 1rem; }
.pz-final-cta__title { font-size: clamp(2.5rem, 6vw, 4.5rem); margin-bottom: 2rem; line-height: 1.1; }
.pz-final-cta__sub {
  margin: 0 auto 3rem;
  max-width: 36rem;
  font-size: 1.25rem;
  color: rgba(255,255,255,.8);
}

/* ---------- Page hero ---------- */
.pz-page-hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 0;
}
.pz-page-hero--dark { background: #000; color: #fff; }
.pz-page-hero__inner { position: relative; z-index: 1; }
.pz-page-hero__title { margin: .75rem 0 1rem; font-size: clamp(2.25rem, 5vw, 4.5rem); }
.pz-page-hero__sub { font-size: 1.125rem; color: #9ca3af; max-width: 42rem; }

/* ---------- Prose (page.php content) ---------- */
.pz-prose-section { padding: 4rem 0; }
.pz-prose { font-size: 1.0625rem; line-height: 1.75; color: var(--foreground); }
.pz-prose h2 { margin-top: 2.5rem; margin-bottom: 1rem; font-size: 1.875rem; }
.pz-prose h3 { margin-top: 2rem; margin-bottom: .75rem; font-size: 1.375rem; }
.pz-prose p { margin: 1rem 0; }
.pz-prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.pz-prose a:hover { color: var(--secondary); }
.pz-prose ul, .pz-prose ol { padding-left: 1.5rem; margin: 1rem 0; }
[dir="rtl"] .pz-prose ul, [dir="rtl"] .pz-prose ol { padding-left: 0; padding-right: 1.5rem; }
.pz-prose ul { list-style: disc; }
.pz-prose ol { list-style: decimal; }
.pz-prose blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted-foreground);
  font-style: italic;
}
[dir="rtl"] .pz-prose blockquote { border-left: 0; border-right: 4px solid var(--primary); padding-left: 0; padding-right: 1.25rem; }
.pz-prose code {
  background: var(--muted);
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .9em;
}
.pz-prose img { border-radius: var(--radius); margin: 1.5rem 0; }

/* ---------- Posts (blog) ---------- */
.pz-post-grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 768px) { .pz-post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .pz-post-grid { grid-template-columns: repeat(3, 1fr); } }
.pz-post-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.pz-post-card:hover { transform: translateY(-4px); border-color: rgba(183,37,37,.3); }
.pz-post-card__thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.pz-post-card__body { padding: 1.25rem; }
.pz-post-card__title { font-size: 1.25rem; margin-bottom: .5rem; }
.pz-post-card__title a:hover { color: var(--primary); }
.pz-post-card__meta { color: var(--muted-foreground); font-size: .875rem; margin-bottom: .75rem; }
.pz-post-card__excerpt { color: var(--muted-foreground); font-size: .9375rem; }

.pz-empty-state { text-align: center; padding: 4rem 0; color: var(--muted-foreground); }

/* Comments */
.pz-comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.pz-comments__title { font-size: 1.5rem; margin-bottom: 1.5rem; }
.pz-comments__list { display: flex; flex-direction: column; gap: 1.5rem; }
.pz-comments__list ol { padding-left: 2rem; }

/* ---------- Footer ---------- */
.pz-footer {
  background: var(--background);
  border-top: 1px solid var(--border);
  padding: 4rem 0;
}
.pz-footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .pz-footer__grid { grid-template-columns: repeat(4, 1fr); gap: 3rem; }
}
.pz-footer__brand { display: flex; flex-direction: column; gap: 1rem; }
.pz-footer__tagline { color: var(--muted-foreground); font-size: .875rem; max-width: 18rem; margin: 0; }
.pz-footer__socials { display: flex; gap: 1rem; margin-top: .5rem; }
.pz-footer__socials a {
  color: var(--muted-foreground);
  transition: color .15s;
}
.pz-footer__socials a:hover { color: var(--foreground); }
.pz-footer__col { display: flex; flex-direction: column; gap: .75rem; }
.pz-footer__heading { font-size: 1rem; font-weight: 600; color: var(--foreground); }
.pz-footer__list { display: flex; flex-direction: column; gap: .75rem; }
.pz-footer__link {
  color: var(--muted-foreground);
  font-size: .875rem;
  transition: color .15s;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
}
[dir="rtl"] .pz-footer__link { text-align: right; }
.pz-footer__link:hover { color: var(--primary); }
.pz-footer__bottom {
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
@media (min-width: 768px) { .pz-footer__bottom { flex-direction: row; justify-content: space-between; } }
.pz-footer__copy { color: var(--muted-foreground); font-size: .875rem; margin: 0; }
.pz-footer__bottom-actions { display: flex; gap: 1.5rem; }

/* ---------- Support chat ---------- */
.pz-support-chat { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 50; }
[dir="rtl"] .pz-support-chat { right: auto; left: 1.5rem; }
.pz-support-chat__bubble {
  width: 3.5rem; height: 3.5rem; border-radius: 9999px;
  background: var(--primary);
  color: #fff;
  border: 0;
  box-shadow: 0 10px 30px -8px rgba(183,37,37,.5);
  display: flex; align-items: center; justify-content: center;
  transition: background-color .2s, transform .15s;
}
.pz-support-chat__bubble:hover { background: var(--secondary); transform: scale(1.05); }
.pz-support-chat__window {
  width: 370px;
  max-width: calc(100vw - 1.5rem);
  height: 520px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 60px -15px rgba(0,0,0,.4);
  position: absolute;
  bottom: 0; right: 0;
}
[dir="rtl"] .pz-support-chat__window { right: auto; left: 0; }
.pz-support-chat__window[hidden] { display: none; }
.pz-support-chat__header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}
.pz-support-chat__avatar {
  width: 2.25rem; height: 2.25rem;
  border-radius: 9999px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pz-support-chat__title-wrap { flex: 1; min-width: 0; }
.pz-support-chat__title { margin: 0; font-size: .875rem; font-weight: 700; }
.pz-support-chat__status { margin: 0; font-size: .75rem; color: rgba(255,255,255,.7); }
.pz-support-chat__icon-btn { color: #fff; }
.pz-support-chat__icon-btn:hover { background: rgba(255,255,255,.15); }
.pz-support-chat__messages {
  flex: 1; overflow-y: auto;
  padding: 1rem; display: flex; flex-direction: column; gap: .75rem;
}
.pz-msg {
  max-width: 82%;
  padding: .625rem 1rem;
  border-radius: var(--radius-xl);
  font-size: .875rem;
  line-height: 1.5;
  word-wrap: break-word;
  animation: pz-msg-in .2s ease-out;
}
@keyframes pz-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.pz-msg--user { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.pz-msg--bot { background: var(--muted); color: var(--foreground); border: 1px solid var(--border); border-bottom-left-radius: 4px; align-self: flex-start; }
[dir="rtl"] .pz-msg--user { border-bottom-right-radius: var(--radius-xl); border-bottom-left-radius: 4px; }
[dir="rtl"] .pz-msg--bot { border-bottom-left-radius: var(--radius-xl); border-bottom-right-radius: 4px; }

.pz-msg-token { display: inline-block; }

.pz-typing {
  display: inline-flex; gap: .25rem;
  align-self: flex-start;
  background: var(--muted);
  border: 1px solid var(--border);
  padding: .75rem 1rem;
  border-radius: var(--radius-xl);
  border-bottom-left-radius: 4px;
}
.pz-typing__dot {
  width: .375rem; height: .375rem; border-radius: 9999px; background: var(--primary);
  animation: pz-bounce .6s ease-in-out infinite;
}
.pz-typing__dot:nth-child(2) { animation-delay: .15s; }
.pz-typing__dot:nth-child(3) { animation-delay: .3s; }
@keyframes pz-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.pz-support-chat__quick {
  display: flex; flex-wrap: wrap; gap: .375rem;
  padding: 0 1rem .5rem;
  flex-shrink: 0;
}
.pz-quick-btn {
  padding: .25rem .75rem;
  background: rgba(183,37,37,.1);
  color: var(--primary);
  border: 1px solid rgba(183,37,37,.2);
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 500;
  transition: background-color .15s;
}
.pz-quick-btn:hover { background: rgba(183,37,37,.2); }

.pz-support-chat__input {
  padding: .5rem .75rem .75rem;
  border-top: 1px solid var(--border);
  display: flex; gap: .5rem;
  flex-shrink: 0;
}

.pz-input {
  flex: 1;
  height: 2.5rem;
  padding: 0 .75rem;
  background: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .875rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.pz-input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* ---------- Fade-in helpers ---------- */
.pz-fade-in, .pz-fade-in-up { opacity: 0; transform: translateY(20px); transition: opacity .8s, transform .8s; will-change: opacity, transform; }
.pz-fade-in { transform: none; }
.pz-fade-in.is-visible, .pz-fade-in-up.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .pz-fade-in, .pz-fade-in-up { opacity: 1; transform: none; transition: none; }
  .pz-hero__tilde, .pz-badge__dot, .pz-typing__dot { animation: none; }
}

/* RTL icon flip (e.g. arrows after CTAs) */
[dir="rtl"] .pz-btn--primary svg,
[dir="rtl"] .pz-btn--ghost-light svg { transform: scaleX(-1); }
