:root {
  color-scheme: dark;
  --bg: #0b0b11;
  --panel: #12131a;
  --panel-2: #161823;
  --border: #252838;
  --text: #f7f7fb;
  --muted: #a5a9bb;
  --accent: #6ee7ff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(11, 11, 17, 0.85);
  border-bottom: 1px solid var(--border);
}

.site-nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-nav nav {
  display: flex;
  gap: 18px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.site-nav a:hover {
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(110, 231, 255, 0.7);
}

/* Hamburger menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  box-shadow: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.hamburger:hover {
  transform: none;
  box-shadow: none;
}

.nav-cta { display: none !important; }
.desktop-cta { display: inline-flex; }

.site-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
  background: var(--accent);
  color: #0b0b11;
  box-shadow: 0 10px 26px rgba(110, 231, 255, 0.25);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn {
  border: 1px solid var(--border);
  color: var(--text);
}

.ghost-btn:hover {
  transform: translateY(-1px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
  align-items: center;
}

.hero-content h1 {
  font-size: 46px;
  margin: 12px 0 16px;
  font-family: "Montserrat", "Inter", sans-serif;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 16px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.hero-stats .hero-stat-title {
  margin: 0 0 6px;
  font-size: 16px;
}

.hero-stats p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-card {
  background: linear-gradient(150deg, #1a1d2c, #0b0b11);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
}

.hero-preview {
  background: #0f111a;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

.preview-tag {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(110, 231, 255, 0.15);
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 14px;
}

.preview-lines span {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  margin-bottom: 10px;
}

.preview-lines span:nth-child(2) {
  width: 80%;
}

.preview-lines span:nth-child(3) {
  width: 60%;
}

.preview-qr {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 88px;
  height: 88px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.feature-card {
  padding: 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.feature-card p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 13px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.step {
  padding: 18px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.step-number {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.template-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px;
  background: linear-gradient(160deg, #151825, #0f111a);
}

.template-card p {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 13px;
}

/* Testimonials */
.testimonials {
  text-align: center;
}

.testimonials h2 {
  margin-bottom: 24px;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.testimonial-card {
  padding: 24px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  text-align: left;
}

.testimonial-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px;
  font-style: italic;
}

.testimonial-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Contact section (simple) */
.contact-section {
  text-align: center;
  padding: 36px 20px;
}

.contact-section > p {
  color: var(--muted);
  margin: 8px 0 0;
}

.contact-section a {
  color: var(--accent);
  text-decoration: none;
}

.contact-section a:hover {
  text-decoration: underline;
}

/* ── Chat widget ──────────────────────────────────────── */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.chat-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0b11;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(110, 231, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(110, 231, 255, 0.45);
}

.chat-bubble.open {
  background: var(--border);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chat-panel {
  width: 380px;
  height: 500px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.chat-header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 6px;
}

.chat-close-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transform: none;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #0b0b11;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-msg.system {
  align-self: center;
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  font-size: 12px;
  text-align: center;
  border-radius: 10px;
  max-width: 95%;
}

.chat-msg.agent {
  align-self: flex-end;
  background: rgba(110, 231, 255, 0.12);
  color: var(--text);
  border: 1px solid rgba(110, 231, 255, 0.3);
  border-bottom-right-radius: 4px;
}

.chat-waiting {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  color: var(--muted);
  font-size: 12px;
}

.chat-waiting-dots {
  display: flex;
  gap: 6px;
}

.chat-waiting-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: chatWaitPulse 1.4s infinite ease-in-out;
}

.chat-waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatWaitPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
}

.chat-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  margin-bottom: 0;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #0b0b11;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  box-shadow: 0 4px 12px rgba(110, 231, 255, 0.3);
}

.chat-escalate-row {
  padding: 0 14px 12px;
  background: var(--panel-2);
}

.chat-escalate-btn {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 12px;
  cursor: pointer;
}

.chat-escalate-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: none;
  transform: none;
}

.chat-escalate-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat-typing {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: chatDot 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── Dashboard styles ─────────────────────────────────── */
.dash-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.dash-title {
  font-family: "Montserrat", "Inter", sans-serif;
  font-size: 28px;
  margin: 0 0 24px;
}

.dash-loading,
.dash-denied {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.dash-denied h2 {
  color: var(--text);
  margin-bottom: 12px;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dash-section-header h2 {
  margin: 0;
  font-size: 20px;
}

.dash-filter {
  display: flex;
  gap: 8px;
}

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

.dash-chat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.dash-chat-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.dash-chat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dash-chat-name {
  font-weight: 600;
  font-size: 14px;
}

.dash-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-badge.escalated {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.dash-badge.active {
  background: rgba(110, 231, 255, 0.15);
  color: var(--accent);
}

.dash-badge.closed {
  background: rgba(165, 169, 187, 0.15);
  color: var(--muted);
}

.dash-chat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.dash-detail-header {
  margin: 16px 0;
}

.dash-detail-header h3 {
  margin: 0 0 4px;
}

.dash-detail-messages {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.dash-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-msg.user .dash-msg-role { color: var(--accent); }
.dash-msg.assistant .dash-msg-role { color: var(--muted); }
.dash-msg.agent .dash-msg-role { color: #818cf8; }
.dash-msg.system .dash-msg-role { color: #34d399; }

.dash-msg-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-msg-content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.dash-msg-time {
  font-size: 11px;
  color: var(--muted);
}

.dash-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-reply-row {
  display: flex;
  gap: 10px;
}

.dash-reply-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 0;
}

.dash-reply-btn {
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #0b0b11;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.cta {
  text-align: center;
  padding: 36px 20px;
  border-radius: 20px;
  background: linear-gradient(140deg, rgba(110, 231, 255, 0.12), rgba(15, 16, 24, 0.9));
  border: 1px solid var(--border);
}

.cta p {
  color: var(--muted);
  margin: 6px 0 20px;
}

.site-footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--text);
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.app-header h1 {
  margin: 0 0 6px;
  font-family: "Montserrat", "Inter", sans-serif;
  font-size: 28px;
}

.app-header p {
  margin: 0;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 12px;
}

button {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #0b0b11;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(110, 231, 255, 0.2);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.ghost:hover {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

button.ghost.active {
  border-color: var(--accent);
  color: var(--accent);
}

.app-main {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 28px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 18px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  margin-bottom: 14px;
  font-family: "Inter", sans-serif;
}

textarea {
  resize: vertical;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.tab-menu {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: #1b2033;
  border-color: rgba(110, 231, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.35);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 12px;
  font-size: 13px;
  color: var(--text);
}

.toggle input {
  width: 16px;
  height: 16px;
}

.text-layers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 8px;
}

.text-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.text-preset {
  border: 1px solid var(--border);
  background: #111321;
  color: #ffffff;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.text-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 255, 0.6);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.text-preset:active {
  transform: translateY(0);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.stat-card {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 12px;
  padding: 12px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.text-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-2);
}

.text-block.active {
  border-color: rgba(110, 231, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.4);
}

.text-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.text-block textarea {
  margin-bottom: 12px;
}

.text-block .row input,
.text-block .row select {
  margin-bottom: 0;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

#ssHeadlineColorInput {
  height: 42px;
  padding: 4px 6px;
}

.ref-image-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ref-image-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.ref-image-btn:hover {
  border-color: var(--accent);
}

.ref-image-clear {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
}

.ref-image-clear:hover {
  color: #f87171;
  transform: none;
  box-shadow: none;
}

.ref-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.ref-image-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px 4px 10px;
  font-size: 13px;
  color: var(--muted);
  max-width: 180px;
}

.ref-image-chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-image-chip .remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.ref-image-chip .remove:hover {
  color: #f87171;
  transform: none;
  box-shadow: none;
}

.app-link-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 4px;
}

.app-link-row input {
  flex: 1;
  margin-bottom: 0;
}

.app-link-row button {
  flex-shrink: 0;
  white-space: nowrap;
}

.preview {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  min-height: 520px;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  background: #0f1018;
  border-radius: 16px;
  padding: 16px;
}

.canvas-actions {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.inline-editor {
  position: absolute;
  z-index: 5;
  background: rgba(15, 16, 24, 0.9);
  border: 1px solid rgba(110, 231, 255, 0.7);
  color: #ffffff;
  padding: 6px 8px;
  border-radius: 10px;
  outline: none;
  resize: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

#flyerCanvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #090a10;
  touch-action: none;
}

.status {
  background: rgba(15, 16, 24, 0.75);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}

button.small {
  padding: 6px 12px;
  font-size: 12px;
}

/* Auth overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 11, 17, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  width: 380px;
  max-width: 90vw;
}

.auth-card {
  position: relative;
}

.auth-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 8px;
}

.auth-close-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transform: none;
}

.auth-card h2 {
  margin: 0 0 20px;
  font-size: 20px;
  text-align: center;
}

.google-btn {
  width: 100%;
  padding: 12px 16px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.google-btn:hover {
  background: #f7f8f8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-btn-row {
  display: flex;
  gap: 10px;
}

.auth-btn-row button {
  flex: 1;
}

.auth-error {
  color: #f87171;
  font-size: 13px;
  margin: 10px 0 0;
  min-height: 18px;
}

/* User info */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
}

/* Flyer list modal */
.flyer-list-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(11, 11, 17, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.flyer-list-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  width: 720px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
}

.flyer-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.flyer-list-header h2 {
  margin: 0;
  font-size: 18px;
}

.flyer-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.flyer-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.flyer-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.flyer-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  background: var(--bg);
}

.flyer-card-info {
  padding: 10px;
}

.flyer-card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flyer-card-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.flyer-card-actions {
  padding: 0 10px 10px;
}

.flyer-card-actions button {
  padding: 4px 10px;
  font-size: 11px;
}

/* Pricing overlay */
.pricing-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(11, 11, 17, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pricing-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  width: 580px;
  max-width: 94vw;
}

.pricing-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 8px;
}

.pricing-close-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transform: none;
}

.pricing-title {
  margin: 0 0 20px;
  font-size: 22px;
  text-align: center;
}

/* Billing toggle */
.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.billing-label {
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s;
}

.billing-label.active {
  color: var(--text);
  font-weight: 600;
}

.save-tag {
  display: inline-block;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
  vertical-align: middle;
}

.billing-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
  box-shadow: none;
}

.billing-switch:hover {
  transform: none;
  box-shadow: none;
}

.billing-switch.yearly {
  background: var(--accent);
}

.billing-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: left 0.2s;
}

.billing-switch.yearly .billing-knob {
  left: 23px;
  background: #0b0b11;
}

.plan-price-sub {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: -4px;
  margin-bottom: 8px;
  min-height: 18px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.plan-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
}

.plan-card.pro {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.3), 0 8px 24px rgba(110, 231, 255, 0.1);
}

.plan-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.plan-price {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
}

.plan-price span {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.plan-features li {
  font-size: 13px;
  color: var(--text);
  padding-left: 20px;
  position: relative;
}

.plan-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.plan-features li.disabled {
  color: var(--muted);
  text-decoration: line-through;
}

.plan-features li.disabled::before {
  content: "\2717";
  color: #f87171;
}

.plan-badge {
  text-align: center;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
}

.plan-badge.pro-badge {
  background: var(--accent);
  color: #0b0b11;
  border-color: var(--accent);
}

.subscribe-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--accent);
  color: #0b0b11;
  border: none;
  cursor: pointer;
}

.subscribe-btn:hover {
  box-shadow: 0 8px 20px rgba(110, 231, 255, 0.3);
}

.manage-sub {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text);
}

.manage-sub p {
  margin: 0 0 12px;
}

.manage-sub-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.manage-sub a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.manage-sub a:hover {
  background: rgba(110, 231, 255, 0.08);
  border-color: var(--accent);
}

#cancelSubLink {
  color: #f87171;
}

#cancelSubLink:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: #f87171;
}

.get-pro-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--accent);
  color: #0b0b11;
  border: none;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.get-pro-btn:hover {
  box-shadow: 0 8px 20px rgba(110, 231, 255, 0.3);
}

.get-pro-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
}

.toast.success { border-color: #34d399; }
.toast.error { border-color: #f87171; }
.toast.info { border-color: var(--accent); }

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

button.loading {
  pointer-events: none;
  opacity: 0.7;
}

@media (max-width: 980px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .desktop-cta {
    display: none !important;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .site-nav nav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 8px 0;
    border-top: 1px solid var(--border);
  }

  .site-nav nav.open {
    display: flex;
  }

  .site-nav nav a,
  .site-nav nav .nav-cta {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
  }

  .nav-cta {
    display: inline-flex !important;
    text-align: center;
    margin-top: 8px;
    border-bottom: none !important;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .templates {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    width: calc(100vw - 32px);
    height: 420px;
  }

  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ── FAQ section ──────────────────────────────────────── */
.faq-section {
  text-align: center;
  padding: 36px 0;
}

.faq-section h2 {
  margin-bottom: 24px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  text-align: left;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: "\2212";
  transform: rotate(180deg);
}

.faq-item summary:hover {
  color: var(--accent);
}

.faq-item p {
  padding: 0 20px 16px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 768px) {
  .faq-grid {
    grid-template-columns: 1fr;
  }
}
