﻿/* ================================================
   MARKITAL — Marketing Tools Hub — Stylesheet
   ================================================ */

:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light: #ede9fe;
  --secondary: #db2777;
  --accent: #f59e0b;
  --bg: #fafafa;
  --bg-alt: #f5f3ff;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 25px rgba(0,0,0,0.14);
  --radius: 8px;
  --radius-lg: 14px;
  --transition: 0.2s ease;
  --gradient: linear-gradient(135deg, #1e1b4b 0%, #3730a3 40%, #7c3aed 80%, #db2777 100%);
}

/* LANGUAGE VISIBILITY — visibility controlled via inline styles by setLang() in app.js */

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
p { margin-bottom: 1rem; }
h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.2rem; font-weight: 600; }

/* CONTAINER */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ================================================
   HEADER
================================================ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  text-decoration: none;
}
.site-logo em { color: var(--text); font-style: normal; }

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.875rem;
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition);
}
.header-search input:focus { border-color: var(--primary); background: white; }
.header-search .ico { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.site-nav { display: flex; gap: 0.25rem; margin-left: auto; }
.site-nav a {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.site-nav a:hover { color: var(--primary); background: var(--primary-light); text-decoration: none; }

/* DROPDOWN */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 300;
  max-height: 380px;
  overflow-y: auto;
}
.search-dropdown.active { display: block; }
.search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: var(--text);
}
.search-result:hover { background: var(--bg-alt); text-decoration: none; }
.search-result .r-icon { font-size: 1.25rem; flex-shrink: 0; }
.search-result .r-name { font-weight: 600; font-size: 0.875rem; display: block; }
.search-result .r-desc { font-size: 0.78rem; color: var(--text-muted); }

/* ================================================
   AD UNITS
================================================ */
.ad-wrapper {
  text-align: center;
  padding: 0.75rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ad-unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fffbeb;
  border: 1px dashed #fcd34d;
  border-radius: 4px;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  max-width: 100%;
}
.ad-unit::after { content: 'Ad'; position: absolute; top: 3px; right: 6px; font-size: 0.65rem; color: #b45309; }
.ad-leaderboard { width: 728px; height: 90px; }
.ad-rectangle { width: 336px; height: 280px; }
.ad-sidebar-box { width: 300px; height: 250px; }
.ad-sidebar-tall { width: 300px; height: 600px; position: sticky; top: 5rem; }
.ad-in-content { width: 100%; max-width: 728px; height: 90px; margin: 1.5rem auto; }
.ad-mobile-banner { width: 320px; height: 50px; }

/* ================================================
   HERO
================================================ */
.hero {
  background: var(--gradient);
  color: white;
  text-align: center;
  padding: 4.5rem 1.25rem 3.5rem;
}
.hero h1 { font-size: 2.6rem; margin-bottom: 1rem; text-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.hero p { font-size: 1.15rem; opacity: 0.88; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-search { max-width: 600px; margin: 0 auto; position: relative; }
.hero-search input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  box-shadow: 0 4px 25px rgba(0,0,0,0.2);
  outline: none;
  color: var(--text);
}
.hero-search .ico {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2.5rem;
}
.hero-stat strong { display: block; font-size: 1.9rem; font-weight: 800; }
.hero-stat span { font-size: 0.85rem; opacity: 0.75; }

/* AI BADGE IN HERO */
.hero-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: 0.03em;
}

/* ================================================
   SECTIONS
================================================ */
.section { padding: 3.5rem 0; }
.section-header { margin-bottom: 2rem; }
.section-title { font-size: 1.65rem; font-weight: 700; margin-bottom: 0.35rem; }
.section-sub { color: var(--text-muted); }

/* ================================================
   CATEGORY CARDS
================================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  display: block;
  color: inherit;
  transition: all var(--transition);
  cursor: pointer;
}
.cat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.cat-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.cat-name { font-weight: 700; font-size: 1rem; margin-bottom: 0.2rem; }
.cat-count { font-size: 0.8rem; color: var(--text-muted); }

/* ================================================
   TOOL CARDS
================================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.tool-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tool-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.tool-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.tool-card p { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 1.25rem; line-height: 1.55; flex: 1; }
.tool-card-footer { display: flex; align-items: center; justify-content: space-between; }

/* AI PILL ON TOOL CARD */
.tool-ai-pill {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  letter-spacing: 0.04em;
}

/* BADGES */
.badge { font-size: 0.72rem; padding: 0.2rem 0.6rem; border-radius: 50px; font-weight: 600; }
.badge-copy { background: #d1fae5; color: #065f46; }
.badge-visual { background: #ede9fe; color: #4c1d95; }
.badge-campaign { background: #fef3c7; color: #92400e; }
.badge-ai { background: #fce7f3; color: #9d174d; }

.btn-use {
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  background: var(--primary);
  color: white;
  border-radius: 50px;
  font-weight: 600;
  transition: background var(--transition);
  text-decoration: none;
}
.btn-use:hover { background: var(--primary-dark); text-decoration: none; }

/* ================================================
   TOOL PAGE LAYOUT
================================================ */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}
.tool-main { min-width: 0; }
.tool-sidebar { position: sticky; top: 5rem; }

/* BREADCRUMB */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* TOOL WIDGET */
.tool-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.tool-widget-header {
  background: var(--gradient);
  color: white;
  padding: 1.75rem;
}
.tool-widget-header h1 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.tool-widget-header p { opacity: 0.85; font-size: 0.9rem; margin: 0; }
.tool-widget-body { padding: 1.75rem; }

/* TOOL LAUNCH CARD */
.tool-launch-card {
  background: linear-gradient(135deg, var(--bg-alt), white);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.tool-launch-card .tlc-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.tool-launch-card h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.tool-launch-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(124,58,237,0.35);
}
.btn-launch:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.45);
  text-decoration: none;
  color: white;
}
.tlc-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.75rem; margin-bottom: 0; }

/* FEATURES GRID */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.feature-card .fc-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.feature-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.3rem; }
.feature-card p { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

/* SEO CONTENT ARTICLE */
.seo-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.seo-article h2 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--text); }
.seo-article h3 { font-size: 1.1rem; margin: 1.5rem 0 0.6rem; color: var(--text); }
.seo-article p { color: var(--text-muted); font-size: 0.93rem; line-height: 1.8; }
.seo-article ul, .seo-article ol { margin: 0.75rem 0 1rem 1.5rem; }
.seo-article li { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 0.4rem; list-style: disc; }

/* FAQ */
.faq-section { margin-top: 1.75rem; }
.faq-section h2 { margin-bottom: 1rem; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  overflow: hidden;
}
.faq-q {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  transition: background var(--transition);
  user-select: none;
}
.faq-q:hover { background: var(--bg-alt); }
.faq-icon { transition: transform var(--transition); font-style: normal; }
.faq-item.open .faq-icon { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
  padding: 0 1.25rem;
}
.faq-item.open .faq-a { max-height: 400px; padding: 0.75rem 1.25rem 1rem; }

/* JOURNEY BANNER */
.journey-banner {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.journey-banner a { font-weight: 700; color: var(--primary); text-decoration: none; white-space: nowrap; }
.journey-banner a:hover { text-decoration: underline; }

/* RELATED TOOLS */
.related-tools {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.related-tools h3 { margin-bottom: 1rem; font-size: 1rem; }
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.related-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.83rem;
  color: var(--text);
  transition: all var(--transition);
  text-decoration: none;
}
.related-link:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); text-decoration: none; }
.related-link .rl-icon { font-size: 1.1rem; }

/* SIDEBAR CARD */
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.sidebar-card h4 { font-size: 0.875rem; margin-bottom: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sidebar-tool-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.sidebar-tool-link:last-child { border-bottom: none; }
.sidebar-tool-link:hover { color: var(--primary); text-decoration: none; }

/* INFO BOX */
.info-box {
  background: linear-gradient(135deg, #f0f9ff, var(--primary-light));
  border: 1px solid #c4b5fd;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}
.info-box h4 { color: var(--primary-dark); margin-bottom: 0.75rem; font-size: 0.95rem; }
.info-box p, .info-box li { color: #3730a3; font-size: 0.9rem; margin-bottom: 0.35rem; }

/* ABOUT / STATIC PAGES */
.page-hero {
  background: var(--gradient);
  color: white;
  text-align: center;
  padding: 4rem 1.25rem;
}
.page-hero h1 { font-size: 2.2rem; margin-bottom: 0.75rem; }
.page-hero p { opacity: 0.85; max-width: 600px; margin: 0 auto; }
.page-content {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 1.25rem;
}
.page-content h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; color: var(--text); }
.page-content h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.page-content p { color: var(--text-muted); line-height: 1.8; }
.page-content ul { margin: 0.75rem 0 1rem 1.5rem; }
.page-content ul li { color: var(--text-muted); margin-bottom: 0.4rem; list-style: disc; }

/* ================================================
   FOOTER
================================================ */
.site-footer {
  background: #0f0a1e;
  color: #9ca3af;
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  border-bottom: 1px solid #1f1535;
}
.footer-brand strong { color: white; font-size: 1.2rem; display: block; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.875rem; line-height: 1.65; margin: 0; }
.footer-col h4 { color: white; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 1rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { color: #9ca3af; font-size: 0.875rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: white; text-decoration: none; }
.footer-bottom {
  text-align: center;
  padding: 1.5rem 1.25rem 0;
  font-size: 0.8rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ================================================
   LANGUAGE TOGGLE
================================================ */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.15rem;
  flex-shrink: 0;
}
.lang-btn {
  background: none;
  border: none;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  border-radius: 50px;
  color: var(--text-muted);
  transition: all var(--transition);
  letter-spacing: 0.04em;
}
.lang-btn.active { background: var(--primary); color: white; }
.lang-btn:hover:not(.active) { color: var(--primary); }

/* ================================================
   404 PAGE
================================================ */
.page-404 {
  text-align: center;
  padding: 8rem 1.25rem;
}
.page-404 .err-code { font-size: 6rem; font-weight: 900; color: var(--primary); line-height: 1; }
.page-404 h2 { font-size: 1.75rem; margin: 1rem 0 0.75rem; }
.page-404 p { color: var(--text-muted); max-width: 400px; margin: 0 auto 2rem; }
.btn-home { display: inline-block; padding: 0.8rem 2rem; background: var(--primary); color: white; border-radius: 50px; font-weight: 700; }
.btn-home:hover { background: var(--primary-dark); text-decoration: none; }

/* ================================================
   RESPONSIVE
================================================ */
@media (max-width: 1024px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.85rem; }
  .hero-stats { gap: 2rem; }
  .hero-stat strong { font-size: 1.5rem; }
  .site-nav { display: none; }
  .related-grid { grid-template-columns: 1fr; }
  .ad-leaderboard { width: 320px; height: 50px; }
  .features-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .header-search { display: none; }
  .categories-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat strong { font-size: 1.3rem; }
}

/* ================================================
   FEEDBACK WIDGET
================================================ */
#feedback-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124,58,237,0.4);
  z-index: 9000;
  transition: transform var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
#feedback-btn:hover { background: var(--primary-dark); transform: scale(1.1); }

#feedback-modal { display: none; position: fixed; inset: 0; z-index: 9500; }
#feedback-modal.active { display: block; }

.fb-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }

.fb-dialog {
  position: absolute;
  bottom: 5.5rem;
  right: 1.5rem;
  width: min(370px, calc(100vw - 2rem));
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}
.fb-dialog h3 { font-size: 1rem; margin-bottom: 0.4rem; color: var(--text); }
.fb-dialog p { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 0.85rem; }
.fb-dialog textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  line-height: 1.5;
}
.fb-dialog textarea:focus { border-color: var(--primary); }
.fb-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.fb-send {
  flex: 1;
  padding: 0.6rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--transition);
}
.fb-send:hover { background: var(--primary-dark); }
.fb-cancel {
  padding: 0.6rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.fb-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.2rem;
}
.fb-close:hover { color: var(--text); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================
   AI TOOL EMBEDDED LAYOUT
================================================ */
.ai-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.ai-form-panel, .ai-output-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ai-panel-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ai-panel-body { padding: 1.25rem; }
.ai-empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.ai-empty-state .ai-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }
.ai-empty-state p { font-size: 0.875rem; margin: 0; }
.ai-loading { text-align: center; padding: 2.5rem; color: var(--text-muted); }
.ai-spinner { display: block; width: 34px; height: 34px; border: 3px solid var(--primary-light); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 0.75rem; }
.ai-key-bar {
  background: var(--bg-alt);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.ai-key-bar label { font-size: 0.78rem; font-weight: 700; color: var(--primary-dark); white-space: nowrap; }
.ai-key-bar input {
  flex: 1; min-width: 180px;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-family: monospace;
  outline: none;
  background: white;
}
.ai-key-bar input:focus { border-color: var(--primary); }
.key-save {
  padding: 0.4rem 0.85rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.output-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}
.output-card h4 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.45rem; }
.output-card p, .output-val { font-size: 0.875rem; color: var(--text); line-height: 1.65; margin: 0; white-space: pre-wrap; }
.output-copy-btn { margin-top: 0.5rem; padding: 0.25rem 0.6rem; background: none; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.72rem; cursor: pointer; color: var(--text-muted); transition: all var(--transition); }
.output-copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.output-tag { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-size: 0.78rem; padding: 0.2rem 0.55rem; border-radius: 50px; margin: 0.2rem 0.1rem; font-weight: 600; }
.output-tag.warning { background: #fef3c7; color: #92400e; }
.char-pill { font-size: 0.68rem; color: var(--text-muted); background: var(--border); border-radius: 50px; padding: 0.1rem 0.45rem; float: right; margin-top: 0.1rem; }
.char-pill.over { background: #fee2e2; color: #dc2626; }

/* AI FORM INSIDE PANEL */
.ai-panel-body .fg { margin-bottom: 0.85rem; }
.ai-panel-body .fg label { font-size: 0.78rem; font-weight: 600; display: block; margin-bottom: 0.25rem; color: var(--text); }
.ai-panel-body input[type=text],
.ai-panel-body input[type=url],
.ai-panel-body select,
.ai-panel-body textarea {
  width: 100%; padding: 0.5rem 0.7rem; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 0.875rem; outline: none; transition: border-color var(--transition); background: white; color: var(--text); font-family: inherit;
}
.ai-panel-body input:focus, .ai-panel-body select:focus, .ai-panel-body textarea:focus { border-color: var(--primary); }
.ai-panel-body textarea { resize: vertical; min-height: 72px; }
.ai-panel-body .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.btn-generate {
  width: 100%; padding: 0.82rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border: none; border-radius: var(--radius);
  font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all var(--transition);
  margin-top: 0.35rem; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-generate:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(124,58,237,0.3); }
.btn-generate:disabled { opacity: 0.55; cursor: not-allowed; }

/* ================================================
   CALCULATOR STYLES
================================================ */
.calc-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.calc-form-header { background: var(--gradient); color: white; padding: 1.5rem; }
.calc-form-header h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.calc-form-header p { opacity: 0.85; font-size: 0.88rem; margin: 0; }
.calc-body { padding: 1.5rem; }
.calc-results { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; display: none; animation: fadeIn 0.3s ease; }
.calc-results.show { display: block; }
.result-hero { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; border-radius: var(--radius); padding: 1.5rem; text-align: center; margin-bottom: 1rem; }
.result-hero .rv { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.result-hero .rl { font-size: 0.875rem; opacity: 0.85; margin-top: 0.2rem; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.65rem; margin-bottom: 1rem; }
.result-cell { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem; text-align: center; }
.result-cell .rc-val { font-size: 1.15rem; font-weight: 700; color: var(--primary); display: block; }
.result-cell .rc-lbl { font-size: 0.7rem; color: var(--text-muted); }
.verdict-box { border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-top: 0.75rem; font-weight: 600; font-size: 0.875rem; }
.verdict-pass { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.verdict-fail { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.verdict-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.calc-tabs { display: flex; gap: 0.35rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.calc-tab { padding: 0.4rem 0.85rem; border: 1px solid var(--border); border-radius: 50px; background: white; font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all var(--transition); }
.calc-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.calc-panel { display: none; } .calc-panel.active { display: block; }
.fg { margin-bottom: 1rem; }
.fg label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 0.3rem; }
.fg input, .fg select { width: 100%; padding: 0.6rem 0.85rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; outline: none; transition: border-color var(--transition); background: white; color: var(--text); }
.fg input:focus, .fg select:focus { border-color: var(--primary); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.btn-calc { width: 100%; padding: 0.85rem; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 700; cursor: pointer; transition: all var(--transition); margin-top: 0.5rem; }
.btn-calc:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(124,58,237,0.35); }

/* READABILITY GAUGE */
.read-gauge { height: 14px; border-radius: 7px; background: linear-gradient(90deg,#ef4444 0%,#f59e0b 35%,#84cc16 65%,#22c55e 100%); position: relative; margin: 0.75rem 0 0.35rem; }
.read-marker { position: absolute; top: -6px; width: 10px; height: 26px; background: #1e293b; border-radius: 3px; transform: translateX(-50%); transition: left 0.5s ease; }
.read-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* PERSONA CARD */
.persona-card { background: var(--gradient); color: white; border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem; }
.persona-card .pc-name { font-size: 1.4rem; font-weight: 800; }
.persona-card .pc-title { opacity: 0.85; font-size: 0.88rem; margin-top: 0.2rem; }
.persona-card .pc-quote { font-style: italic; opacity: 0.85; font-size: 0.875rem; margin-top: 0.75rem; border-left: 3px solid rgba(255,255,255,0.4); padding-left: 0.75rem; }
.persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin-bottom: 0.65rem; }
.persona-item { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem; }
.persona-item h5 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.4rem; }
.persona-item ul { margin: 0; padding: 0; list-style: none; }
.persona-item ul li { font-size: 0.82rem; color: var(--text); padding: 0.2rem 0; border-bottom: 1px solid var(--border); }
.persona-item ul li:last-child { border-bottom: none; }
.persona-item p { font-size: 0.85rem; color: var(--text); margin: 0; }

@media (max-width: 768px) {
  .ai-split { grid-template-columns: 1fr; }
  .ai-panel-body .row2 { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .persona-grid { grid-template-columns: 1fr; }
}
