@import url('fonts/fonts.css');
    /* CSS Reset & Variables */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --heading: #0f172a;
      --body: #475569;
      --muted: #64748b;
      --brand-blue: #2563eb;
      --brand-violet: #7c3aed;
      --brand-gradient: linear-gradient(90deg, #2563eb, #7c3aed);
      --badge-bg: #eff6ff;
      --badge-border: #bfdbfe;
      --badge-text: #1d4ed8;
      --card-bg: rgba(255, 255, 255, 0.88);
      --card-border: #e2e8f0;
      --success: #16a34a;
      --success-bg: #f0fdf4;
      --warning: #b45309;
      --warning-bg: #fffbeb;
      --error: #dc2626;
      --error-bg: #fef2f2;
      --radius: 14px;
      --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
      --font-heading: 'Outfit', system-ui, -apple-system, sans-serif;
      --font-body: 'Inter', system-ui, -apple-system, sans-serif;
      --font-mono: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
    }

    body {
      font-family: var(--font-body);
      color: var(--body);
      background-color: #ffffff;
      min-height: 100vh;
      line-height: 1.5;
      position: relative;
      overflow-x: hidden;
    }

    /* Soft Mesh Glow Background (CSS radial gradients only) */
    .bg-mesh {
      position: fixed;
      top: 0; left: 0; right: 0; height: 100vh;
      pointer-events: none;
      z-index: -1;
      background:
        radial-gradient(circle at 10% 20%, rgba(169, 214, 245, 0.55) 0%, rgba(169, 214, 245, 0) 50%),
        radial-gradient(circle at 90% 15%, rgba(227, 201, 243, 0.45) 0%, rgba(227, 201, 243, 0) 50%),
        linear-gradient(180deg, transparent 75%, #ffffff 100%);
      filter: blur(50px);
    }

    /* Header */
    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 64px;
      padding: 0 1.5rem;
      background: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--card-border);
      position: sticky;
      top: 0;
      z-index: 40;
    }
    .header-logo {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      text-decoration: none;
      font-family: var(--font-heading);
      font-weight: 800;
      font-size: 1.25rem;
    }
    .logo-mark {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      background: var(--brand-gradient);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-size: 0.9rem;
      box-shadow: 0 2px 8px rgba(37,99,235,0.3);
    }
    .logo-maf { color: #0f172a; }
    .logo-labs {
      background: var(--brand-gradient);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .header-nav {
      display: flex;
      align-items: center;
      gap: 1.25rem;
    }
    .header-nav a {
      color: var(--muted);
      text-decoration: none;
      font-size: 0.9rem;
      font-weight: 500;
      transition: color 0.15s;
    }
    .header-nav a:hover { color: var(--brand-blue); }

    .nav-toggle {
      display: none;
      background: none;
      border: none;
      padding: 8px;
      cursor: pointer;
      color: var(--heading);
    }

    /* Compact Hero (<140px on desktop) */
    .hero-section {
      padding: 0.85rem 1.25rem 0.6rem;
      text-align: center;
      max-width: 1000px;
      margin: 0 auto;
    }
    .badge-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.2rem 0.65rem;
      background: var(--badge-bg);
      border: 1px solid var(--badge-border);
      color: var(--badge-text);
      border-radius: 9999px;
      font-size: 0.75rem;
      font-weight: 600;
      margin-bottom: 0.4rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .hero-h1 {
      font-family: var(--font-heading);
      font-size: 1.65rem;
      font-weight: 800;
      color: var(--heading);
      letter-spacing: -0.025em;
      line-height: 1.2;
      margin-bottom: 0.25rem;
    }
    .hero-gradient {
      background: var(--brand-gradient);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .hero-sub {
      font-size: 0.875rem;
      color: var(--body);
      margin-bottom: 0.2rem;
    }
    .privacy-tag {
      font-size: 0.75rem;
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }

    /* Main Container */
    .main-content {
      max-width: 1600px;
      margin: 0 auto;
      padding: 0 1rem 3rem;
    }

    /* Workspace Toolbar */
    .workspace-toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      margin-bottom: 0.5rem;
      padding: 0.5rem 0.75rem;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius);
      backdrop-filter: blur(10px);
      box-shadow: var(--shadow);
    }
    .toolbar-left, .toolbar-right {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.4rem;
    }

    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      padding: 0.45rem 0.85rem;
      font-size: 0.85rem;
      font-weight: 600;
      border-radius: 10px;
      cursor: pointer;
      min-height: 38px;
      transition: all 0.15s ease;
      text-decoration: none;
      user-select: none;
    }
    .btn:focus-visible {
      outline: none;
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
    }
    .btn-primary {
      background: var(--brand-gradient);
      color: #ffffff;
      border: none;
      box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    }
    .btn-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(79, 70, 229, 0.32);
    }
    .btn-secondary {
      background: #ffffff;
      color: var(--heading);
      border: 1px solid var(--card-border);
    }
    .btn-secondary:hover {
      border-color: var(--brand-blue);
      color: var(--brand-blue);
    }
    .btn-icon {
      padding: 0.45rem;
      min-width: 38px;
    }

    /* Options Popover */
    .options-dropdown {
      position: relative;
      display: inline-block;
    }
    .options-panel {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      margin-top: 0.4rem;
      width: 290px;
      background: #ffffff;
      border: 1px solid var(--card-border);
      border-radius: 12px;
      padding: 0.85rem;
      box-shadow: 0 10px 30px rgba(0,0,0,0.12);
      z-index: 50;
    }
    .options-panel.open { display: block; }
    .option-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.35rem 0;
      font-size: 0.82rem;
      color: var(--heading);
    }
    .option-item label { cursor: pointer; user-select: none; }
    .option-item input[type="checkbox"] {
      width: 16px;
      height: 16px;
      cursor: pointer;
      accent-color: var(--brand-blue);
    }

    /* Candidates Strip */
    .candidates-strip {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0.75rem;
      background: rgba(255,255,255,0.7);
      border: 1px solid var(--card-border);
      border-radius: 10px;
      margin-bottom: 0.5rem;
      overflow-x: auto;
      font-size: 0.8rem;
    }
    .candidates-label {
      color: var(--muted);
      font-weight: 600;
      white-space: nowrap;
    }
    .candidate-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      padding: 0.25rem 0.6rem;
      border-radius: 6px;
      background: #fff;
      border: 1px solid var(--card-border);
      color: var(--heading);
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.15s;
    }
    .candidate-pill:hover {
      border-color: var(--brand-blue);
      color: var(--brand-blue);
    }
    .candidate-pill.active {
      background: var(--badge-bg);
      border-color: var(--brand-blue);
      color: var(--brand-blue);
      font-weight: 600;
    }
    .candidate-score {
      font-size: 0.7rem;
      background: rgba(0,0,0,0.05);
      padding: 1px 4px;
      border-radius: 4px;
    }

    /* Workspace Split Screen Layout */
    .workspace-wrapper {
      position: relative;
      height: calc(100vh - 230px);
      min-height: 560px;
      display: flex;
      gap: 0;
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }
    .workspace-wrapper.focus-mode {
      position: fixed;
      inset: 0;
      height: 100vh !important;
      z-index: 100;
      border-radius: 0;
      padding: 0.75rem;
      background: #f8fafc;
    }

    .pane {
      display: flex;
      flex-direction: column;
      background: var(--card-bg);
      backdrop-filter: blur(10px);
      border: 1px solid var(--card-border);
      border-radius: var(--radius);
      overflow: hidden;
      min-width: 250px;
      position: relative;
    }
    .pane-left {
      flex: 0 0 50%;
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
      border-right: none;
    }
    .pane-right {
      flex: 1 1 0;
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }

    /* Drag Divider */
    .workspace-divider {
      width: 8px;
      background: #e2e8f0;
      cursor: col-resize;
      transition: background 0.15s;
      position: relative;
      z-index: 10;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .workspace-divider::after {
      content: '';
      width: 2px;
      height: 32px;
      background: #94a3b8;
      border-radius: 2px;
    }
    .workspace-divider:hover, .workspace-divider.dragging {
      background: var(--brand-blue);
    }

    /* Pane Header */
    .pane-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.5rem 0.85rem;
      background: rgba(255, 255, 255, 0.95);
      border-bottom: 1px solid var(--card-border);
      font-size: 0.82rem;
    }
    .pane-title {
      font-family: var(--font-heading);
      font-weight: 700;
      color: var(--heading);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .detected-chain-chip {
      font-size: 0.72rem;
      font-weight: 500;
      background: var(--badge-bg);
      color: var(--badge-text);
      border: 1px solid var(--badge-border);
      padding: 0.15rem 0.5rem;
      border-radius: 9999px;
      max-width: 320px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .pane-stats {
      font-size: 0.75rem;
      color: var(--muted);
      margin-left: auto;
      margin-right: 0.5rem;
    }
    .pane-actions {
      display: flex;
      align-items: center;
      gap: 0.3rem;
    }

    /* Pane Body & Editors */
    .pane-body {
      flex: 1;
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
      background: #ffffff;
    }
    .editor-textarea {
      flex: 1;
      width: 100%;
      height: 100%;
      padding: 0.85rem;
      font-family: var(--font-mono);
      font-size: 15px;
      line-height: 1.6;
      color: var(--heading);
      border: none;
      resize: none;
      outline: none;
      background: transparent;
      white-space: pre-wrap;
      word-break: break-all;
    }
    .editor-textarea::placeholder {
      color: #94a3b8;
    }

    /* Output Display: text or highlighted diff view */
    .output-viewer {
      flex: 1;
      width: 100%;
      height: 100%;
      padding: 0.85rem;
      font-family: var(--font-mono);
      font-size: 15px;
      line-height: 1.6;
      color: var(--heading);
      overflow: auto;
      white-space: pre-wrap;
      word-break: break-all;
    }
    .diff-highlight {
      background-color: #bbf7d0;
      color: #14532d;
      padding: 1px 3px;
      border-radius: 3px;
      font-weight: 600;
    }
    .unrecoverable-highlight {
      background-color: #fecaca;
      color: #991b1b;
      padding: 1px 3px;
      border-radius: 3px;
      text-decoration: underline wavy #ef4444;
    }

    /* Drag & Drop Overlays */
    .drop-overlay {
      position: absolute;
      inset: 0;
      background: rgba(37, 99, 235, 0.08);
      border: 2px dashed var(--brand-blue);
      border-radius: var(--radius);
      display: none;
      align-items: center;
      justify-content: center;
      color: var(--brand-blue);
      font-weight: 600;
      z-index: 20;
      pointer-events: none;
    }
    .pane.dragover .drop-overlay { display: flex; }

    /* Empty state */
    .empty-state {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
      text-align: center;
      color: var(--muted);
      pointer-events: none;
    }
    .empty-state button, .empty-state a {
      pointer-events: auto;
      color: var(--brand-blue);
      text-decoration: underline;
      background: none;
      border: none;
      cursor: pointer;
      font-weight: 600;
    }

    /* Live Announcement Banner */
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .notice-bar {
      padding: 0.35rem 0.75rem;
      font-size: 0.75rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--card-border);
    }
    .notice-info { background: #f8fafc; color: var(--muted); }
    .notice-warning { background: var(--warning-bg); color: var(--warning); font-weight: 500; }

    /* Progress bar */
    .worker-progress-bar {
      height: 3px;
      width: 0%;
      background: var(--brand-gradient);
      transition: width 0.2s;
    }

    /* Sticky Bottom Action Bar for Mobile (<900px) */
    .sticky-mobile-bar {
      display: none;
      position: sticky;
      bottom: 0;
      left: 0;
      right: 0;
      background: rgba(255,255,255,0.92);
      backdrop-filter: blur(12px);
      border-top: 1px solid var(--card-border);
      padding: 0.6rem 1rem;
      z-index: 35;
      gap: 0.5rem;
    }

    /* Collapsible Reference Table */
    .collapsible-card {
      margin-top: 1.5rem;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius);
      padding: 1rem;
      backdrop-filter: blur(8px);
      box-shadow: var(--shadow);
    }
    .collapsible-card summary {
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: 1rem;
      color: var(--heading);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      user-select: none;
    }
    .mojibake-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 0.75rem;
      font-size: 0.85rem;
    }
    .mojibake-table th, .mojibake-table td {
      padding: 0.5rem 0.75rem;
      border-bottom: 1px solid var(--card-border);
      text-align: left;
    }
    .mojibake-table th {
      color: var(--muted);
      font-weight: 600;
      background: rgba(0,0,0,0.02);
    }
    .mojibake-table code {
      font-family: var(--font-mono);
      font-size: 0.9em;
      background: #f1f5f9;
      padding: 2px 4px;
      border-radius: 4px;
    }

    /* SEO & Educational Content Section */
    .seo-content {
      max-width: 960px;
      margin: 2.5rem auto 0;
      color: var(--body);
      font-size: 0.95rem;
      line-height: 1.7;
    }
    .seo-content h2 {
      font-family: var(--font-heading);
      font-size: 1.35rem;
      font-weight: 800;
      color: var(--heading);
      margin: 2rem 0 0.75rem;
      letter-spacing: -0.02em;
    }
    .seo-content h3 {
      font-family: var(--font-heading);
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--heading);
      margin: 1.25rem 0 0.5rem;
    }
    .seo-content p {
      margin-bottom: 1rem;
    }
    .seo-content ol, .seo-content ul {
      margin: 0.5rem 0 1.25rem 1.5rem;
    }
    .seo-content li {
      margin-bottom: 0.4rem;
    }
    .code-comparison {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
      margin: 1.25rem 0;
    }
    .code-box {
      background: #0f172a;
      color: #f8fafc;
      padding: 1rem;
      border-radius: 10px;
      font-family: var(--font-mono);
      font-size: 0.85rem;
      overflow-x: auto;
    }
    .code-box .code-label {
      font-family: var(--font-body);
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #94a3b8;
      margin-bottom: 0.4rem;
      display: block;
    }

    /* FAQ Accordions */
    .faq-accordion {
      margin-top: 1rem;
      border: 1px solid var(--card-border);
      border-radius: 10px;
      background: #ffffff;
      overflow: hidden;
      margin-bottom: 0.5rem;
    }
    .faq-accordion summary {
      padding: 0.85rem 1.1rem;
      font-weight: 600;
      color: var(--heading);
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      user-select: none;
    }
    .faq-accordion summary::-webkit-details-marker { display: none; }
    .faq-accordion summary::after {
      content: '+';
      font-size: 1.2rem;
      color: var(--brand-blue);
      font-weight: 700;
    }
    .faq-accordion[open] summary::after {
      content: '–';
    }
    .faq-accordion .faq-body {
      padding: 0.85rem 1.1rem;
      border-top: 1px solid var(--card-border);
      color: var(--body);
      font-size: 0.9rem;
      background: #fbfcfe;
    }

    /* Footer */
    footer {
      border-top: 1px solid var(--card-border);
      padding: 2.5rem 1.5rem;
      background: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(10px);
      margin-top: 4rem;
      text-align: center;
      font-size: 0.85rem;
      color: var(--muted);
    }
    .footer-links {
      display: flex;
      justify-content: center;
      gap: 1.5rem;
      margin-bottom: 1rem;
      flex-wrap: wrap;
    }
    .footer-links a {
      color: var(--heading);
      text-decoration: none;
      font-weight: 500;
    }
    .footer-links a:hover { color: var(--brand-blue); }
    .more-tools-row {
      display: flex;
      justify-content: center;
      gap: 0.75rem;
      flex-wrap: wrap;
      margin-top: 0.75rem;
    }
    .more-tools-row a {
      font-size: 0.8rem;
      color: var(--brand-blue);
      text-decoration: none;
      padding: 0.2rem 0.5rem;
      border-radius: 6px;
      background: var(--badge-bg);
      border: 1px solid var(--badge-border);
    }

    /* Modal / Shortcut Cheat Sheet */
    .modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.4);
      backdrop-filter: blur(4px);
      z-index: 120;
      align-items: center;
      justify-content: center;
      padding: 1rem;
    }
    .modal-backdrop.open { display: flex; }
    .modal-card {
      background: #fff;
      border-radius: var(--radius);
      width: 100%;
      max-width: 440px;
      padding: 1.5rem;
      box-shadow: 0 20px 40px rgba(0,0,0,0.15);
      border: 1px solid var(--card-border);
    }
    .shortcut-table {
      width: 100%;
      margin: 1rem 0;
      font-size: 0.85rem;
    }
    .shortcut-table td { padding: 0.4rem 0; }
    kbd {
      background: #f1f5f9;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      padding: 2px 6px;
      font-family: var(--font-mono);
      font-size: 0.8rem;
      font-weight: 600;
    }

    /* Responsive under 900px */
    @media (max-width: 900px) {
      .workspace-wrapper {
        flex-direction: column;
        height: auto;
        min-height: auto;
      }
      .workspace-divider { display: none !important; }
      .pane-left, .pane-right {
        flex: 1 1 auto;
        min-height: 52vh;
        width: 100%;
        border-radius: var(--radius);
        border: 1px solid var(--card-border);
      }
      .pane-left { margin-bottom: 0.75rem; }
      .sticky-mobile-bar {
        display: flex;
      }
      .code-comparison { grid-template-columns: 1fr; }
    }

    @media (max-width: 700px) {
      .header-nav { display: none; }
      .nav-toggle { display: block; }
      .hero-h1 { font-size: 1.35rem; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
      }
    }


/* Ambient Background Blobs (Fixed across entire viewport) */
.blob-bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  -webkit-filter: blur(80px);
  opacity: 0.85;
  will-change: transform;
}

.blob-1 {
  top: -12vh;
  left: -8vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.32) 0%, rgba(59, 130, 246, 0.16) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-1 20s infinite ease-in-out alternate;
}

.blob-2 {
  top: -10vh;
  right: -10vw;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.28) 0%, rgba(168, 85, 247, 0.15) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-2 24s infinite ease-in-out alternate;
}

.blob-3 {
  bottom: -15vh;
  left: -10vw;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, rgba(14, 165, 233, 0.14) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-3 22s infinite ease-in-out alternate;
}

.blob-4 {
  bottom: -10vh;
  right: -8vw;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, rgba(236, 72, 153, 0.15) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-4 26s infinite ease-in-out alternate;
}

@keyframes blob-float-1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5vw, 6vh) scale(1.06); }
  100% { transform: translate(-3vw, 10vh) scale(0.96); }
}

@keyframes blob-float-2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6vw, 8vh) scale(1.08); }
  100% { transform: translate(4vw, 5vh) scale(0.94); }
}

@keyframes blob-float-3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, -8vh) scale(1.06); }
  100% { transform: translate(-4vw, -4vh) scale(0.95); }
}

@keyframes blob-float-4 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5vw, -6vh) scale(1.08); }
  100% { transform: translate(6vw, -10vh) scale(0.95); }
}

/* Ensure foreground content stacks above blobs */
header, main, footer, .container, .site-header, .site-footer, .workspace, article {
  position: relative;
  z-index: 1;
}
