/* Global site styles - extracted from base.html for caching performance */

/* ═══════════════════════════════════════════════════════════════════
   DESIGN TOKENS — single source of truth for all pages
   Changing a value here propagates across the entire site.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  /* Primary brand color — indigo (#4f46e5 across all pages) */
  --clr-primary:        #4f46e5;
  --clr-primary-dark:   #3730a3;
  --clr-primary-light:  #eef2ff;
  --clr-primary-border: #c7d2fe;
  --clr-accent:         #7c3aed; /* purple — image/video tools */

  /* Text */
  --clr-text:       #111827;
  --clr-text-body:  #374151;
  --clr-text-muted: #6b7280;
  --clr-text-faint: #9ca3af;

  /* Surfaces */
  --clr-bg:            #f6f7fb;
  --clr-surface:       #ffffff;
  --clr-border:        #e5e7eb;
  --clr-border-light:  #f3f4f6;

  /* Layout */
  --w-content:  820px;
  --w-page:    1120px;
  --w-wide:    1280px;

  /* Spacing */
  --space-xs:   8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  40px;
  --space-xl:  60px;
  --space-2xl: 80px;

  /* Typography scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-h1:   clamp(1.8rem, 4vw, 2.8rem);
  --text-h2:   clamp(1.4rem, 3vw, 2rem);

  /* Radius */
  --radius-sm:  6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* ── Global Breadcrumb ───────────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  padding: 16px 0 0; font-size: 0.78rem;
}
@media (max-width: 768px) { .breadcrumb { font-size: 0.62rem; gap: 1px; padding: 10px 0 0; } }
.breadcrumb a {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--clr-text-muted, #6b7280); text-decoration: none; font-weight: 500;
  padding: 4px 8px; border-radius: 6px; transition: color 0.15s, background 0.15s;
}
.breadcrumb a:hover { color: var(--clr-primary, #4f46e5); background: var(--clr-primary-light, #eef2ff); }
.bc-sep {
  color: #cbd5e1; display: flex; align-items: center; padding: 0 2px;
}
.bc-cur {
  padding: 4px 8px; color: #111827; font-weight: 600;
  border-radius: 6px; background: #eef2ff; border: 1px solid #dbe3f0;
}
/* Breadcrumb bar — fixed wrapper used by every page */
.bc-bar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.bc-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 768px) { .bc-inner { padding: 0 18px; } }
.bc-bar .breadcrumb { padding: 12px 0; }

/* Dark-hero pages: add class "breadcrumb--dark" to the <nav> element */
.breadcrumb--dark a { color: rgba(255,255,255,0.55) !important; }
.breadcrumb--dark a:hover { color: #fff !important; background: rgba(255,255,255,0.08) !important; }
.breadcrumb--dark .bc-sep { color: rgba(255,255,255,0.25) !important; }
.breadcrumb--dark .bc-cur { color: rgba(255,255,255,0.9) !important; background: rgba(255,255,255,0.07) !important; border-color: rgba(255,255,255,0.15) !important; }
/* body.light-bg kept for backward compat — now redundant since dark is the default */
body.light-bg .breadcrumb a { color: rgba(0,0,0,0.45); }
body.light-bg .breadcrumb a:hover { color: #111; background: rgba(0,0,0,0.05); }
body.light-bg .bc-sep { color: rgba(0,0,0,0.2); }
body.light-bg .bc-cur { color: #111; background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.1); }

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global: flat link hover */
a:hover { }

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f7f7f8;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: hidden; /* Prevent body scrollbars - each layout handles its own scroll */
}

body.top-banner-menu-is-active, body.modal-is-active {
    overflow: hidden;
}

/* ── Global Nav - IAsk style: always light ── */
.top-fixed-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.07);
    z-index: 1009;
    display: flex;
    align-items: center;
    padding: 0;
    color: #1a1a2e;
    flex-shrink: 0;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.nav-logo-img {
    height: 64px;
    width: auto;
    aspect-ratio: 565 / 240;
    display: block;
}

.logo-ai-mark {
    background: #6d28d9;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 5px;
    display: inline-block;
    margin-left: 2px;
    margin-right: 1px;
    line-height: 1.2;
    vertical-align: baseline;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.header-logo-white {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.02em;
}
.header-logo-beta {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: normal;
    color: #9ca3af;
    background-color: #f3f4f6;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Desktop Navigation - IAsk style */
.desktop-nav {
    display: none;
    align-items: center;
    margin-left: 20px;
    gap: 2px;
}
.desktop-chat-container {
    display: flex;
    align-items: center;
    position: relative;
}
.desktop-chat-models-inline {
    display: flex;
    align-items: center;
}
.desktop-chat-models-inline .chat-option,
.desktop-nav-item .chat-option {
    color: #374151;
    text-decoration: none;
    padding: 7px 13px;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.desktop-chat-models-inline .chat-option:hover,
.desktop-nav-item .chat-option:hover {
    background: #f3f4f6;
    color: #111;
}
/* First nav item gets the iAsk "active pill" look */
.desktop-nav > .desktop-nav-item:first-child > .chat-option {
    background: #fff;
    color: #111;
    font-weight: 600;
}

/* Dropdowns - Light style */
.desktop-nav-item {
    position: relative;
}
.desktop-submenu {
    display: none;
    position: absolute;
    top: 100%;
    padding-top: 8px;
    left: 0;
    background: #fff;
    z-index: 1010;
    min-width: 190px;
    list-style: none;
    padding: 4px;
    border-radius: 12px;
    overflow: hidden;
}
.desktop-nav-item:hover .desktop-submenu {
    display: block;
}
.desktop-submenu li a {
    display: block;
    padding: 9px 14px;
    color: #374151;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    background: transparent;
    border-radius: 8px;
    transition: background 0.12s, color 0.12s;
}
.desktop-submenu li a:hover {
    background: #f5f3ff;
    color: #6d28d9;
}
/* More generic class for styling chevrons in dropdown triggers */
.desktop-dropdown-trigger .fa-chevron-down {
    font-size: 0.8em; /* This will now apply to both */
    margin-left: 6px;
    transition: transform 0.2s ease-in-out;
}

/* Animation for the chevron on hover of the parent nav item */
.desktop-nav-item:hover .desktop-dropdown-trigger .fa-chevron-down {
    transform: rotate(180deg);
}

.banner-spacer-flex-grow {
    flex-grow: 1;
    display: block;
}

/* Auth section - IAsk style: separate Sign Up / Log In links */
.desktop-user-info {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.desktop-user-info a {
    color: #374151;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    padding: 7px 13px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.desktop-user-info a:hover {
    background: #f3f4f6;
    color: #111;
}
.desktop-user-info a.btn-header-login:hover {
    background: #5b21b6;
    color: #fff;
}
.credit-display {
    font-size: 13px;
    color: #6b7280;
    background-color: #f3f4f6;
    padding: 6px 10px;
    border-radius: 4px;
    margin-right: 5px;
}
.credit-display span {
    white-space: nowrap;
}
/* END: Added styles for Login/Signup section */


/* Mobile Menu Toggle (SVG Hamburger) */
.top-banner-mobile-menu-toggle {
    display: none;
    cursor: pointer;
    padding: 10px;
    width: 44px;
    height: 40px;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    position: relative;
}
.top-banner-mobile-menu-toggle .hamburger-icon {
    width: 24px;
    height: 24px;
    display: block;
}
.top-banner-mobile-menu-toggle .hamburger-icon .line {
    fill: none;
    stroke: #374151;
    stroke-width: 2;
    stroke-linecap: round;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform-origin: center;
}
/* hamburger stays as 3 lines - Close handled inside drawer */

/* Mobile Menu Container */
.top-banner-mobile-menu {
    position: fixed; /* Establishes positioning context for absolute children */
    top: 72px;      /* Below the top banner */
    left: 0;        /* Spans full width */
    right: 0;       /* Spans full width */
    bottom: 0;      /* Spans full height (remaining) */
    background-color: #000000; /* Fallback background, panels will cover this */
    color: white;
    z-index: 1005;  /* Below hamburger toggle if it were to overlap, above page content */
    transform: translateY(-100%); /* Initially hidden above */
    transition: transform 0.3s ease-in-out;
    visibility: hidden; /* Hidden when off-screen */
    overflow: hidden; /* CRUCIAL: Clips any child panels that slide outside its bounds */
    backface-visibility: hidden; /* Perf optimization for transforms */
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d; /* Perf optimization for transforms */
    will-change: transform; /* Hint to browser about upcoming transform */
}
.top-banner-mobile-menu.open {
    transform: translateY(0); /* Slides into view */
    visibility: visible;
}

/* Mobile Menu Panels (e.g., main menu, professions submenu) */
.mobile-menu-panel {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;   
    height: 100%;  
    background-color: #000000; /* Default background for ALL panels */
    display: flex;
    flex-direction: column; 
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%); 
    z-index: 100; 
    will-change: transform; 
	overflow: hidden; 
}

.mobile-menu-panel.active {
    transform: translateX(0);
    z-index: 102; 
}

.mobile-menu-panel.mobile-menu-main-panel {
    z-index: 101; 
}

.mobile-menu-panel.active {
    transform: translateX(0);
    z-index: 102; /* Active panel is visually on top */
}

/* Header common to all mobile panels */
.mobile-menu-panel .mobile-menu-header {
    font-size: 18px;
    font-weight: 600;
    padding: 0 15px;
    min-height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    flex-shrink: 0;
    border-bottom: 1px solid #333333;
}
.mobile-menu-panel .mobile-menu-header-title {
    color: #f0f0f0;
    text-align: right;
    flex-grow: 1;
}

.mobile-menu-back-button {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 16px;
    padding: 10px;
    margin-left: -10px;
    display: flex;
    align-items: center;
}
.mobile-menu-back-button i {
    margin-right: 8px;
}

/* Scrollable content area within any panel */
.mobile-menu-panel .mobile-menu-scrollable-content {
    overflow-y: auto;   
    flex-grow: 1;
    min-height: 0;
}
.mobile-menu-panel .mobile-menu-scrollable-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}


/* General link styling within panel's scrollable content AND panel trigger links */
.mobile-menu-panel .mobile-menu-scrollable-content ul li a,
.mobile-menu-item-is-trigger > a {
    color: #e0e0e0;
    text-decoration: none;
    display: block;
    padding: 15px 25px;
    font-size: 17px;
    border-bottom: 1px solid #222222;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.mobile-menu-item-is-trigger > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-panel .mobile-menu-scrollable-content ul li a:hover,
.mobile-menu-panel .mobile-menu-scrollable-content ul li a:focus,
.mobile-menu-item-is-trigger > a:hover,
.mobile-menu-item-is-trigger > a:focus {
    background-color: #1a1a1a;
    color: white;
}

.mobile-menu-panel .mobile-menu-scrollable-content ul li:last-child a {
    border-bottom: none;
}

.mobile-menu-main-panel .mobile-menu-static-links {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex-shrink: 0;
    border-top: 1px solid #333333;
}
.mobile-menu-main-panel .mobile-menu-static-links li a {
    color: #b0b0b0;
    text-decoration: none;
    display: block;
    padding: 10px 25px;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: none;
}

.mobile-menu-main-panel .mobile-menu-static-links li a:hover,
.mobile-menu-main-panel .mobile-menu-static-links li a:focus {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

/* Wrapper for page content below the fixed banner */
.page-content-wrapper {
    flex: 0 0 calc(100vh - 72px);
    height: calc(100vh - 72px);
    margin-top: 72px;
    padding-top: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: auto;
    scrollbar-color: #9ca3af #f3f4f6;
    scrollbar-gutter: stable;
}
/* dvh fix: iOS Safari counts 100vh including the address-bar chrome, so the
   page extends off-screen. 100dvh tracks the actual visible viewport. */
@supports (height: 100dvh) {
  .page-content-wrapper {
    flex: 0 0 calc(100dvh - 72px);
    height: calc(100dvh - 72px);
  }
}
.page-content-wrapper::-webkit-scrollbar {
    width: 14px;
}
.page-content-wrapper::-webkit-scrollbar-track {
    background: #f3f4f6;
}
.page-content-wrapper::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border: 3px solid #f3f4f6;
    border-radius: 999px;
}
.page-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #7c3aed;
}

/* Specific layout for chat pages */
body.layout-chat .page-content-wrapper {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-height: 0;
    scrollbar-width: none;
}
body.layout-chat .page-content-wrapper::-webkit-scrollbar {
    display: none;
}

/* START: Added styles for Flash Messages */
.flash-messages-container {
    position: fixed;
    top: 70px; /* Below the main banner */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1010;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.flash-message {
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}
.flash-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.flash-message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
/* END: Added styles for Flash Messages */


/* START: NEW styles for Enhanced Upgrade/Login Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000; visibility: hidden; opacity: 0;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.modal-overlay.active { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s 0s; }

.modal-content {
    background: white; border-radius: 16px;
    max-width: 400px; width: 90%; position: relative;
    transform: scale(0.95); transition: transform 0.3s ease;
    overflow: hidden; /* Important for panel transitions */
}
.modal-overlay.active .modal-content { transform: scale(1); }

.hidden {
    display: none !important;
}	

.modal-panel {
    padding: 24px; transition: transform 0.3s ease, opacity 0.3s ease;
}
/* This style makes non-active panels invisible and non-interactive, but keeps them in the DOM for transitions */
.modal-panel.hidden {
    position: absolute; top: 0; left: 0; width: 100%;
    transform: translateX(100%); opacity: 0; pointer-events: none;
}


.modal-close-btn {
    position: absolute; top: 12px; right: 12px;
    background: none; border: none; font-size: 28px;
    color: #9ca3af; cursor: pointer; line-height: 1; z-index: 10;
}
.modal-close-btn:hover { color: #333; }

.modal-back-btn {
    background: none; border: none; color: #6b7280;
    font-size: 14px; font-weight: 500; cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 16px; padding: 4px;
}
.modal-back-btn:hover { color: #111827; }

/* Soft-paywall modal: inline tier picker */
.modal-pricing-perks { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center;
    font-size: 12px; color: #4b5563; margin: 6px 0 14px; }
.modal-pricing-perks span { white-space: nowrap; }

.modal-cycle-toggle { display: flex; gap: 0; background: #f3f4f6; padding: 3px;
    border-radius: 999px; margin: 0 auto 14px; width: max-content; }
.modal-cycle-toggle button { background: transparent; border: 0; padding: 6px 14px;
    border-radius: 999px; font-size: 12px; font-weight: 600; color: #4b5563; cursor: pointer; }
.modal-cycle-toggle button.active { background: #fff; color: #111; }
.modal-cycle-toggle .cycle-save { background: #ecfdf5; color: #059669; padding: 1px 6px;
    border-radius: 999px; font-size: 10px; margin-left: 4px; }

.modal-tiers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.modal-tier-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    border: 1px solid #e5e7eb; border-radius: 10px; transition: border-color .15s; background: #fff; }
.modal-tier-card.featured { border-color: #4f46e5; position: relative; }
.modal-tier-card.featured::before { content: attr(data-ribbon); position: absolute; top: -9px; right: 12px;
    background: #4f46e5; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; }
.modal-tier-info { flex: 1; min-width: 0; text-align: left; }
.modal-tier-name { font-weight: 700; font-size: 14px; color: #111; margin: 0 0 2px; }
.modal-tier-sub { font-size: 12px; color: #6b7280; margin: 0; }
.modal-tier-price { text-align: right; flex-shrink: 0; }
.modal-tier-price .amount { font-size: 20px; font-weight: 800; color: #111; line-height: 1; }
.modal-tier-price .unit { font-size: 11px; color: #6b7280; display: block; margin-top: 2px; }
.modal-tier-cta { padding: 10px 14px; border: 0; border-radius: 8px; background: #4f46e5;
    color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.modal-tier-cta:hover { background: #4338ca; }
.modal-tier-cta[disabled] { opacity: .6; cursor: not-allowed; }
.modal-tier-loading { text-align: center; color: #9ca3af; font-size: 13px; padding: 16px; }
.modal-tier-empty { text-align: center; color: #6b7280; font-size: 13px; padding: 16px; }
.modal-pricing-foot { text-align: center; font-size: 12px; color: #6b7280; margin: 4px 0 0; }
.modal-pricing-foot a { color: #4f46e5; text-decoration: none; }
.modal-pricing-foot a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .modal-tier-card { flex-wrap: wrap; }
    .modal-tier-info { flex-basis: 60%; }
    .modal-tier-price { text-align: right; }
    .modal-tier-cta { flex-basis: 100%; margin-top: 6px; }
}

.modal-title { font-size: 24px; font-weight: 700; color: #111827; margin-bottom: 8px; text-align: center; }
.modal-message { font-size: 16px; color: #4b5563; line-height: 1.5; margin-bottom: 24px; text-align: center; }

.modal-actions { display: flex; flex-direction: column; gap: 12px; }
.modal-actions .btn {
    display: flex; align-items: center; justify-content: center; width: 100%;
    padding: 14px 20px; border-radius: 8px; text-decoration: none;
    font-weight: 600; font-size: 16px; border: 1px solid transparent;
    transition: all 0.2s ease;
}
.modal-actions .btn-google { background-color: #4285F4; color: white; }
.modal-actions .btn-google:hover { background-color: #357ae8; }
.modal-actions .btn-google .fab { font-size: 20px; margin-right: 12px; }

.modal-actions .btn-email { background-color: #f9fafb; color: #374151; border-color: #d1d5db; }
.modal-actions .btn-email:hover { background-color: #f3f4f6; border-color: #9ca3af; }

.modal-divider {
    height: 1px; background-color: #e5e7eb; margin: 20px 0;
    display: flex; align-items: center; justify-content: center;
    color: #9ca3af; font-size: 12px;
}
.modal-divider::before, .modal-divider::after {
    content: ''; flex: 1; height: 1px; background-color: #e5e7eb;
}
.modal-divider span { padding: 0 10px; background-color: white; }

.modal-actions .btn-premium { 
    background-image: #fde68a;
    color: #422006;
    border-color: #f59e0b;
    font-weight: 700;
}
.modal-actions .btn-premium:hover { 
    background-image: #fef08a;
    border-color: #eab308;
}
.modal-actions .btn-premium .rocket-icon { margin-right: 8px; }

/* Email Form Styles */
.form-group { text-align: left; margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.form-group input {
    width: 100%; padding: 10px; border-radius: 6px;
    border: 1px solid #d1d5db; font-size: 16px;
}
.form-group input:focus { border-color: #4f46e5; outline: none; }
.btn-submit { background-color: #4f46e5; color: white; }
.btn-submit:hover { background-color: #4338ca; }
.form-switch-link { text-align: center; font-size: 14px; margin-top: 16px; }
.form-switch-link a { color: #4f46e5; text-decoration: none; font-weight: 500; }
.form-switch-link a:hover { text-decoration: underline; }

/* NEW: For displaying form feedback messages */
.form-feedback {
    font-size: 14px;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    text-align: center;
    display: none; /* Hidden by default */
}
.form-feedback.success {
    background-color: #d1fae5;
    color: #065f46;
}
.form-feedback.error {
    background-color: #fee2e2;
    color: #991b1b;
}


/* Pricing Panel Styles */
.pricing-option {
    border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px;
    text-align: left; cursor: pointer; transition: all 0.2s ease;
}
.pricing-option:hover, .pricing-option.selected { border-color: #4f46e5; }
.pricing-option .plan-name { font-weight: 600; color: #111827; }
.pricing-option .plan-price { font-size: 14px; color: #6b7280; }
.pricing-option .plan-price span { font-weight: 600; color: #111827; }

/* Stripe Payment Form Styles */
#stripe-payment-container { transition: max-height 0.3s ease-out, opacity 0.3s ease-out; max-height: 0; opacity: 0; overflow: hidden; }
#stripe-payment-container.visible { max-height: 300px; opacity: 1; }
#stripe-payment-form { margin-top: 16px; }
.StripeElement { height: 44px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; }
.StripeElement--focus { border-color: #4f46e5; }
#card-errors { margin-top: 8px; color: #dc2626; font-size: 12px; }
#spinner { border: 3px solid #f3f3f3; border-top: 3px solid #ffffff; border-radius: 50%; width: 20px; height: 20px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
/* END: NEW styles for Enhanced Upgrade/Login Modal */


/* Login/Sign Up - IAsk style: prominent pill button */
.btn-header-login {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: #6d28d9;
    color: #fff !important;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    transition: background 0.15s;
    letter-spacing: 0.01em;
}
.btn-header-login:hover {
    background: #5b21b6;
}

/* Nav inner container for max-width centering */
.nav-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}
/* Inline SVG icons in nav */
.nav-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    vertical-align: -2px;
}

/* Media Queries for navigation visibility */
@media (max-width: 768px) {
    .desktop-nav, .desktop-user-info {
        display: none !important;
    }
    .top-banner-mobile-menu-toggle {
        display: flex;
    }
    .banner-spacer-flex-grow {
        flex-grow: 0; /* Don't need it on mobile if user info is hidden */
        margin-left: auto; /* Push hamburger to the right */
    }
}

@media (min-width: 769px) {
    .desktop-nav {
        display: flex;
    }
    .top-banner-mobile-menu-toggle,
    .top-banner-mobile-menu {
        display: none !important;
    }
}

.katex-display > .katex {
    text-align: left !important;
}







/* START: Styles for Account Dropdown */
.account-icon-trigger {
    padding: 4px 8px !important; /* Use important to override more general styles if needed */
}
.account-icon-trigger i {
    font-size: 24px; /* Makes the user icon larger and more clickable */
    vertical-align: middle;
}

/* Group labels inside AI Chat dropdown */
.desktop-submenu li.submenu-group-label {
    padding: 8px 14px 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    cursor: default;
    border-top: 1px solid #f3f4f6;
    margin-top: 2px;
}
.desktop-submenu li.submenu-group-label:first-child {
    border-top: none;
    margin-top: 0;
}
.submenu-badge {
    display: inline-block;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Style for the non-clickable info item in the dropdown */
.desktop-submenu .submenu-info-item {
    padding: 12px 14px;
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
    line-height: 1.5;
    border-radius: 8px 8px 0 0;
    margin-bottom: 2px;
}

/* Style for the logout link to align the icon */
.desktop-submenu li a.logout-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* END: Styles for Account Dropdown */

/* Fix for right-aligned desktop dropdown */
.desktop-submenu.right-aligned-submenu {
    left: auto;
    right: 0;
}
/* Two-column dropdown variant */
.desktop-submenu--two-col {
    display: none;
    position: absolute;
    top: 100%;
    padding-top: 8px;
    left: 0;
    background: #fff;
    z-index: 1010;
    border-radius: 12px;
    overflow: hidden;
    flex-direction: row;
    min-width: 380px;
}
.desktop-nav-item:hover .desktop-submenu--two-col {
    display: flex;
}
.desktop-submenu--two-col .submenu-col {
    list-style: none;
    padding: 4px;
    flex: 1;
    min-width: 0;
}
.desktop-submenu--two-col .submenu-col + .submenu-col {
    border-left: 1px solid rgba(0,0,0,0.06);
}
.desktop-submenu--two-col li a {
    display: block;
    padding: 9px 14px;
    color: #374151;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    background: transparent;
    border-radius: 8px;
    transition: background 0.12s, color 0.12s;
}
.desktop-submenu--two-col li a:hover {
    background: #f5f3ff;
    color: #6d28d9;
}
.desktop-submenu--two-col li.submenu-group-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 10px 14px 4px;
    cursor: default;
}





.mobile-account-trigger {
    display: none; /* Hidden by default */
    color: #374151;
    font-size: 24px;
    cursor: pointer;
    padding: 0 15px;
    align-items: center;
}

.mobile-account-info-box {
    display: none; /* Hidden by default */
    position: fixed;
    top: 72px; /* Attach directly to the bottom of the 60px banner */
    left: 0;
    width: 100%;
    background-color: #111111; /* A dark, slightly off-black color */
    color: #f0f0f0;
    border-radius: 0; /* No rounded corners */
    z-index: 1008;
    padding: 20px;
    font-size: 16px;
    box-sizing: border-box; /* Ensures padding doesn't break width */
    border-top: 1px solid #333;
}

.info-box-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.info-box-close-btn:hover {
    color: white;
}

.mobile-account-info-box .info-box-item {
    padding: 8px 10px;
}

.mobile-account-info-box .info-box-upgrade-link {
    display: block;
    margin-top: 15px;
    padding: 12px;
    background-color: #333333;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.mobile-account-info-box .info-box-upgrade-link:hover {
    background-color: #444444;
}




/* Updated Media Query to show/hide mobile/desktop elements */
@media (max-width: 768px) {
    .desktop-nav, .desktop-user-info {
        display: none !important;
    }
    .top-banner-mobile-menu-toggle {
        display: flex;
    }
    .mobile-account-trigger {
        display: flex; /* Show mobile account icon */
    }
    .banner-spacer-flex-grow {
        flex-grow: 1; /* Push the two icons to the right */
    }
}


/* Landing page: page-content-wrapper override (so hero fills screen) */

/* Profession pages: contextual internal link clusters */
.profession-context-links {
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    padding: 58px 20px 64px;
}

.profession-context-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 34px;
    align-items: start;
}

.profession-context-label {
    color: #6d28d9;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.profession-context-links h2 {
    color: #111827;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    line-height: 1.25;
    margin: 0 0 14px;
    font-weight: 850;
}

.profession-context-copy {
    color: #4b5563;
    font-size: 0.96rem;
    line-height: 1.75;
    margin: 0 0 14px;
}

.profession-context-copy a {
    color: #5b21b6;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.profession-context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.profession-context-card {
    display: block;
    min-height: 124px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 18px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}

.profession-context-card:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
}

.profession-context-card strong {
    display: block;
    color: #111827;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.profession-context-card span {
    display: block;
    color: #6b7280;
    font-size: 0.84rem;
    line-height: 1.55;
}

@media (max-width: 820px) {
    .profession-context-links {
        padding: 42px 16px 48px;
    }

    .profession-context-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .profession-context-grid {
        grid-template-columns: 1fr;
    }

    .profession-context-card {
        min-height: auto;
    }
}


/* ══ Global Mobile Polish ══════════════════════════════════════════════════════
   Applies site-wide. Targets both CSS-class-based and common inline patterns.
   ─────────────────────────────────────────────────────────────────────────── */

/* Utility: responsive 3-column grid → 1 column on mobile */
.resp-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* Utility: horizontally scrollable wrapper for wide tables */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}
.table-scroll table {
    min-width: unset !important;
}

@media (max-width: 640px) {

    /* ── Grid collapse ── */
    .resp-3col {
        grid-template-columns: 1fr;
    }

    /* ── Hero padding ── */
    .lp-hero {
        padding: 64px 16px 40px;
        min-height: auto;
    }

    /* ── Section spacing ── */
    .lp-section {
        padding: 40px 0 !important;
    }

    /* ── Headings on content pages ── */
    .gd-hero h1,
    .gl-hero h1,
    .bs-hero h1,
    .cmp-hero h1,
    .tool-hero h1,
    .lib-hero h1 {
        font-size: clamp(1.4rem, 6vw, 1.9rem) !important;
        line-height: 1.25 !important;
    }

    /* ── Input card ── */
    .lp-input-card {
        border-radius: 14px;
        padding: 16px 14px 12px;
    }

    /* ── Ask AI button: compact on mobile (not full-width) ── */
    .lp-ask-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    /* ── Model chips: smaller on mobile ── */
    .lp-chip {
        font-size: 0.72rem;
        padding: 4px 9px;
    }

    /* ── Landing page section containers ── */
    .lp-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* ── Stat numbers ── */
    .stat-num {
        font-size: 1.4rem !important;
    }

    /* ── Responsive model/card auto-fill grids → min 140px (2 cols on 320px) ── */
    [style*="grid-template-columns:repeat(auto-fill,minmax(150px"] {
        /* handled inline — already responsive via auto-fill */
    }

    /* ── Footer grid ── */
    .lp-footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }

    /* ── Tools row: stack on mobile ── */
    .lp-tools-row {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    /* ── Split sections ── */
    .lp-split-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    /* ── SEO grid ── */
    .lp-seo-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    /* ── Tables: prevent horizontal blowout ── */
    table {
        max-width: 100%;
    }

    /* ── Feature cards: remove hover transform on touch ── */
    .lp-feat:hover,
    .lp-tool-card:hover,
    .profession-context-card:hover {
        transform: none;
    }

    /* ── Modal: full-width on small phones ── */
    .modal-content {
        width: 96% !important;
        border-radius: 12px !important;
    }

    /* ── Flash messages: full-width ── */
    .flash-messages-container {
        width: 96%;
    }
}

/* Tablet range: 2-col instead of 3 */
@media (min-width: 641px) and (max-width: 900px) {
    .resp-3col {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Comprehensive mobile optimisation ─────────────────────────────────── */
@media (max-width: 640px) {

    /* ── Feature cards: icon + text side-by-side ── */
    .lp-feat {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 14px;
        padding: 16px 14px;
    }
    .lp-feat-icon {
        width: 48px !important;
        height: 48px !important;
        flex-shrink: 0;
        margin-bottom: 0 !important;
    }
    .lp-feat h3 {
        font-size: 0.95rem !important;
        margin-bottom: 4px !important;
    }
    .lp-feat p {
        font-size: 0.85rem !important;
    }
    .lp-features-grid {
        gap: 12px !important;
    }

    /* ── Page containers: narrow padding on mobile ── */
    .container,
    .hub-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* ── Hub hero ── */
    .hub-hero {
        padding: 24px 0 28px !important;
    }
    .hub-h1 {
        font-size: clamp(1.5rem, 7vw, 2.2rem) !important;
        word-break: break-word;
    }
    .hub-lead {
        font-size: 0.9rem !important;
    }
    .hub-cta-row {
        flex-direction: column;
        align-items: stretch;
    }
    .hub-btn-primary,
    .hub-btn-secondary {
        text-align: center;
        padding: 13px 20px;
    }
    .hub-section {
        padding: 36px 0 !important;
    }

    /* ── Hub section headings ── */
    .hub-section-title {
        font-size: clamp(1.2rem, 5.5vw, 1.6rem) !important;
    }

    /* ── Tool-page hero ── */
    .hero { padding: 28px 0 !important; }
    .hero h1, .tool-hero h1 {
        font-size: clamp(1.4rem, 6vw, 1.9rem) !important;
    }

    /* ── Inline 3-column grids → 1 column ── */
    [style*="grid-template-columns:repeat(3,1fr)"],
    [style*="grid-template-columns: repeat(3,1fr)"],
    [style*="grid-template-columns:repeat(3, 1fr)"],
    [style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* ── Inline 2-column grids → 1 column ── */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:repeat(2,1fr)"],
    [style*="grid-template-columns: repeat(2,1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* ── Named grid classes in hub/tool pages ── */
    .tools-grid {
        grid-template-columns: 1fr !important;
    }
    .models-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .use-cases-grid {
        grid-template-columns: 1fr !important;
    }
    .comparison-grid {
        grid-template-columns: 1fr !important;
    }
    .link-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* ── Chat / tool page textarea ── */
    .chat-input-wrap textarea,
    .prompt-input {
        font-size: 16px !important; /* prevent iOS zoom */
    }

    /* ── Landing page hero button ── */
    .lp-hero-cta-wrap {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Unified content-table style — all light-theme pages
   Applied with !important so per-page styles cannot override.
   ═══════════════════════════════════════════════════════════════════ */

/* Strip border-radius from wrappers, ensure border */
.fmt-table-wrap,
.ratio-table-wrap,
.preset-table-wrap,
.compare-wrap,
.table-scroll {
    border-radius: 0 !important;
    border: 1px solid #e5e7eb !important;
    overflow-x: auto;
    background: #fff;
}

/* Flat purple header on every content table */
.compare-table thead th,
.fmt-table thead th,
.ratio-table thead th,
.preset-table thead th,
.spec-table thead th,
.verdict-table thead th,
.tct thead th,
.vm-compare-table thead th,
.table-scroll table thead th {
    background: #4f46e5 !important;
    color: rgba(255,255,255,0.92) !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    padding: 14px 20px !important;
    white-space: nowrap !important;
    border-bottom: none !important;
    border-radius: 0 !important;
}

/* Cells */
.compare-table td,
.fmt-table td,
.ratio-table td,
.preset-table td,
.spec-table td,
.verdict-table td,
.tct td,
.vm-compare-table td,
.table-scroll table td {
    padding: 13px 20px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    color: #4b5563 !important;
}

/* First column: bold + dark */
.compare-table td:first-child,
.fmt-table td:first-child,
.ratio-table td:first-child,
.preset-table td:first-child,
.spec-table td:first-child,
.verdict-table td:first-child,
.tct td:first-child,
.vm-compare-table td:first-child,
.table-scroll table td:first-child {
    font-weight: 700 !important;
    color: #1a1a2e !important;
}

/* Alternating row tint */
.compare-table tbody tr:nth-child(even) td,
.fmt-table tbody tr:nth-child(even) td,
.ratio-table tbody tr:nth-child(even) td,
.preset-table tbody tr:nth-child(even) td,
.spec-table tbody tr:nth-child(even) td,
.verdict-table tbody tr:nth-child(even) td,
.tct tbody tr:nth-child(even) td,
.vm-compare-table tbody tr:nth-child(even) td,
.table-scroll table tbody tr:nth-child(even) td {
    background: #fafafa !important;
}

/* Hover tint */
.compare-table tbody tr:hover td,
.fmt-table tbody tr:hover td,
.ratio-table tbody tr:hover td,
.preset-table tbody tr:hover td,
.spec-table tbody tr:hover td,
.verdict-table tbody tr:hover td,
.tct tbody tr:hover td,
.vm-compare-table tbody tr:hover td,
.table-scroll table tbody tr:hover td {
    background: #f5f3ff !important;
}

/* Also ensure tct/vm wrappers have consistent border */
.tct-wrap,
.vm-compare-wrap {
    border-radius: 0 !important;
    border: 1px solid #e5e7eb !important;
    overflow-x: auto;
    background: #fff;
}

/* Fix invisible .dash "No" badge in model-family pages (was rgba white) */
.dash { color: #9ca3af !important; }

/* ── Mobile: fix search-box/button overlap on all landing pages ── */
@media (max-width: 640px) {
  /* Turn the form into a column stack */
  .lp-search-wrap form {
    display: flex;
    flex-direction: column;
    position: static;
  }
  /* Remove the right-padding reserved for the absolute button */
  .lp-search-box {
    padding-right: 18px !important;
    border-radius: 8px 8px 0 0 !important;
    min-height: 56px;
  }
  /* Reset absolute positioning and make button full-width below textarea */
  .lp-search-btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    width: 100% !important;
    border-radius: 0 0 8px 8px !important;
    padding: 14px 22px !important;
    font-size: 1rem !important;
    text-align: center !important;
    display: block !important;
  }
  /* Tighten hero sections */
  .lp-prof-hero {
    padding-top: 16px !important;
    padding-bottom: 28px !important;
  }
  .lp-hero-rating {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px !important;
  }
  /* Mode buttons stay on one row */
  .lp-mode-selector {
    flex-wrap: wrap;
    gap: 8px;
  }
  .lp-mode-btn {
    font-size: 0.82rem !important;
    padding: 7px 12px !important;
  }
  /* Sample questions smaller */
  .sample-question {
    font-size: 0.76rem !important;
    padding: 5px 9px !important;
  }
}

/* ── Mobile: make content-area tables scrollable instead of overflowing ── */
@media (max-width: 640px) {
  .term-body table,
  .gd-intro table,
  .gd-step .body table,
  .gd-conclusion table,
  .faq-body table,
  .faq-expanded table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
}

/* ── AI chat message tables: always scrollable + styled consistently ── */
.message-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.875em;
}
.message-content table th,
.message-content table td {
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.message-content table th {
  background: #f3f4f6;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.message-content table tr:nth-child(even) td {
  background: #f9fafb;
}
