/* FreeToolzHub — tool catalog. Every tool here maps to a real, working engine. */
const FTH_TOOLS = [
  /* ---------- PDF ---------- */
  { id:'merge-pdf',  icon:'files',      tone:'red', cat:'pdf', title:'Merge PDF',  desc:'Combine PDFs in the order you want.', pop:true, badge:'Popular' },
  { id:'split-pdf',  icon:'scissors',   tone:'red', cat:'pdf', title:'Split PDF',  desc:'Extract pages or split every page.', pop:true },
  { id:'jpg-to-pdf', icon:'file-image', tone:'red', cat:'pdf', title:'JPG to PDF', desc:'Turn images into one PDF document.' },
  { id:'pdf-to-jpg', icon:'image',      tone:'red', cat:'pdf', title:'PDF to JPG', desc:'Render each page to a JPG image.' },
  { id:'rotate-pdf', icon:'rotate-cw',  tone:'red', cat:'pdf', title:'Rotate PDF', desc:'Rotate all pages 90, 180 or 270°.' },
  { id:'compress-pdf',       icon:'file-minus-2',  tone:'red', cat:'pdf', title:'Compress PDF',       desc:'Reduce file size, keep quality.', pop:true },
  { id:'png-to-pdf',         icon:'file-image',    tone:'red', cat:'pdf', title:'PNG to PDF',          desc:'Images into one PDF document.' },
  { id:'pdf-to-png',         icon:'image',         tone:'red', cat:'pdf', title:'PDF to PNG',          desc:'Each page to a PNG image.' },
  { id:'delete-pdf-pages',   icon:'file-x',        tone:'red', cat:'pdf', title:'Delete PDF Pages',    desc:'Remove pages you don\u2019t need.' },
  { id:'extract-pdf-pages',  icon:'copy-check',    tone:'red', cat:'pdf', title:'Extract PDF Pages',   desc:'Keep only the pages you pick.' },
  { id:'rearrange-pdf-pages',icon:'arrow-left-right', tone:'red', cat:'pdf', title:'Rearrange PDF',    desc:'Reorder pages visually.' },
  { id:'watermark-pdf',      icon:'stamp',         tone:'red', cat:'pdf', title:'Watermark PDF',       desc:'Add a diagonal text watermark.' },
  { id:'pdf-page-numbers',   icon:'list-ordered',  tone:'red', cat:'pdf', title:'PDF Page Numbers',    desc:'Number every page.' },
  { id:'pdf-metadata',       icon:'info',          tone:'red', cat:'pdf', title:'PDF Metadata Editor', desc:'Edit title, author & more.' },
  { id:'sign-pdf',           icon:'pen-line',      tone:'red', cat:'pdf', title:'Sign PDF',            desc:'Add a typed signature.' },
  { id:'pdf-to-text',        icon:'file-text',     tone:'red', cat:'pdf', title:'PDF to Text',         desc:'Extract selectable text.' },
  { id:'pdf-metadata-cleaner',icon:'shield-check', tone:'red', cat:'pdf', title:'PDF Metadata Cleaner',desc:'Strip author, title & hidden data.' },
  { id:'pdf-bookmark-creator',icon:'bookmark',     tone:'red', cat:'pdf', title:'PDF Bookmark Creator',desc:'Add a clickable outline to a PDF.' },
  { id:'bulk-image-to-pdf',  icon:'images',        tone:'red', cat:'pdf', title:'Bulk Image to PDF',   desc:'Many images → one PDF.', pop:true },
  { id:'bulk-pdf-renamer',   icon:'file-pen',      tone:'red', cat:'pdf', title:'Bulk PDF Renamer',    desc:'Batch-rename PDFs → ZIP.' },
  { id:'pdf-viewer',         icon:'eye',           tone:'red', cat:'pdf', title:'PDF Viewer',          desc:'Read PDFs in your browser.' },
  { id:'compare-pdf',        icon:'git-compare',   tone:'red', cat:'pdf', title:'Compare PDF',         desc:'Spot text differences.' },

  /* ---------- Image ---------- */
  { id:'image-compressor', icon:'image-minus',     tone:'green', cat:'image', title:'Image Compressor', desc:'Shrink JPG & PNG up to 90%.', pop:true, badge:'Popular' },
  { id:'convert-image',    icon:'image',           tone:'green', cat:'image', title:'Convert Image',    desc:'JPG · PNG · WEBP, any direction.', pop:true },
  { id:'resize-image',     icon:'scaling',         tone:'green', cat:'image', title:'Resize Image',     desc:'Scale by pixels or percentage.' },
  { id:'rotate-image',     icon:'rotate-cw',       tone:'green', cat:'image', title:'Rotate Image',     desc:'Rotate 90, 180 or 270°.' },
  { id:'flip-image',       icon:'flip-horizontal', tone:'green', cat:'image', title:'Flip Image',       desc:'Mirror horizontally or vertically.' },
  { id:'photo-filters',    icon:'sliders-horizontal', tone:'green', cat:'image', title:'Photo Filters', desc:'Brightness, contrast, blur & more.', pop:true },
  { id:'blur-image',       icon:'droplet',       tone:'green', cat:'image', title:'Blur Image',       desc:'Soften or obscure an image.' },
  { id:'sharpen-image',    icon:'focus',         tone:'green', cat:'image', title:'Sharpen Image',    desc:'Crisp up details (unsharp mask).' },
  { id:'brightness-adjuster', icon:'sun',        tone:'green', cat:'image', title:'Brightness',       desc:'Brighten or darken photos.' },
  { id:'contrast-adjuster',icon:'contrast',      tone:'green', cat:'image', title:'Contrast',         desc:'Punch up or flatten contrast.' },
  { id:'grayscale-filter', icon:'circle-half',   tone:'green', cat:'image', title:'Grayscale',        desc:'Convert to black & white.' },
  { id:'sepia-filter',     icon:'image',         tone:'green', cat:'image', title:'Sepia Filter',     desc:'Warm vintage tone.' },
  { id:'jpg-to-png',       icon:'image',         tone:'green', cat:'image', title:'JPG to PNG',       desc:'Convert JPG → PNG.' },
  { id:'png-to-jpg',       icon:'image',         tone:'green', cat:'image', title:'PNG to JPG',       desc:'Convert PNG → JPG.' },
  { id:'webp-converter',   icon:'image',         tone:'green', cat:'image', title:'WEBP Converter',   desc:'Convert images to WEBP.' },
  { id:'avif-converter',   icon:'image',         tone:'green', cat:'image', title:'AVIF Converter',   desc:'Convert images to AVIF.' },
  { id:'bmp-converter',    icon:'image',         tone:'green', cat:'image', title:'BMP Converter',    desc:'Convert images to BMP.' },
  { id:'gif-converter',    icon:'image',         tone:'green', cat:'image', title:'GIF Converter',    desc:'Convert a frame to GIF/PNG.' },
  { id:'tiff-converter',   icon:'image',         tone:'green', cat:'image', title:'TIFF Converter',   desc:'Convert images (TIFF/PNG).' },
  { id:'ico-converter',    icon:'app-window',    tone:'green', cat:'image', title:'ICO Converter',    desc:'Make a favicon .ico.' },
  { id:'image-to-base64',  icon:'binary',        tone:'green', cat:'image', title:'Image to Base64',  desc:'Data URI for CSS/HTML.' },
  { id:'base64-to-image',  icon:'image-plus',    tone:'green', cat:'image', title:'Base64 to Image',  desc:'Decode Base64 back to image.' },
  { id:'image-watermark',  icon:'stamp',         tone:'green', cat:'image', title:'Image Watermark',  desc:'Text watermark, any position.' },
  { id:'border-generator', icon:'square',        tone:'green', cat:'image', title:'Border Generator', desc:'Add a colored frame.' },
  { id:'meme-generator',   icon:'smile',         tone:'green', cat:'image', title:'Meme Generator',   desc:'Top & bottom meme text.' },
  { id:'collage-maker',    icon:'layout-grid',   tone:'green', cat:'image', title:'Collage Maker',    desc:'Combine images into a grid.' },
  { id:'image-metadata',   icon:'info',          tone:'green', cat:'image', title:'Image Metadata',   desc:'Dimensions, size & ratio.' },
  { id:'image-dpi',        icon:'ruler',         tone:'green', cat:'image', title:'Image DPI Checker',desc:'Print size at 72/150/300 DPI.' },
  { id:'background-remover',icon:'eraser',       tone:'green', cat:'image', title:'Background Remover',desc:'Remove a solid background.' },
  { id:'image-size-reducer', icon:'compress',    tone:'green', cat:'image', title:'Image Size Reducer', desc:'Compress to under 20/50/100 KB.', pop:true },
  { id:'passport-photo-maker', icon:'user-square', tone:'green', cat:'image', title:'Passport Photo Maker', desc:'Crop to passport size + print sheet.' },
  { id:'signature-background-remover', icon:'pen-line', tone:'green', cat:'image', title:'Signature BG Remover', desc:'Transparent signature PNG.' },
  { id:'image-dpi-converter', icon:'ruler',      tone:'green', cat:'image', title:'Image DPI Converter', desc:'Set print DPI (e.g. 300).' },
  { id:'image-resolution-checker', icon:'scan',  tone:'green', cat:'image', title:'Image Resolution Checker', desc:'Size, megapixels & print size.' },
  { id:'social-media-image-resizer', icon:'crop', tone:'green', cat:'image', title:'Social Media Resizer', desc:'Perfect size for every platform.', pop:true },
  { id:'favicon-pack-generator', icon:'app-window', tone:'green', cat:'image', title:'Favicon Pack Generator', desc:'Full favicon set + manifest ZIP.' },

  /* ---------- Productivity & Business ---------- */
  { id:'prompt-library',           icon:'library',         tone:'teal', cat:'productivity', title:'AI Prompt Library',        desc:'18 ready-to-use prompts, copy & go.', pop:true },
  { id:'prompt-optimizer',         icon:'wand-sparkles',   tone:'teal', cat:'productivity', title:'AI Prompt Optimizer',      desc:'Turn a rough idea into a structured prompt.' },
  { id:'meeting-notes-formatter',  icon:'clipboard-list',  tone:'teal', cat:'productivity', title:'Meeting Notes Formatter',  desc:'Rough notes → clean summary & actions.' },
  { id:'resume-skills-generator',  icon:'list-checks',     tone:'teal', cat:'productivity', title:'Resume Skills Generator',  desc:'Role-matched skills for your CV.' },
  { id:'job-description-matcher',  icon:'target',          tone:'teal', cat:'productivity', title:'Job Description Matcher',  desc:'Score your resume vs a job posting.', pop:true },
  { id:'cover-letter-customizer',  icon:'file-pen',        tone:'teal', cat:'productivity', title:'Cover Letter Customizer',  desc:'Tailored cover letter in seconds.' },
  { id:'email-signature-generator',icon:'mail',            tone:'teal', cat:'productivity', title:'Email Signature Generator',desc:'Pro HTML signature, copy & paste.' },
  { id:'invoice-generator',        icon:'receipt',         tone:'teal', cat:'productivity', title:'Invoice Generator',        desc:'Line items → printable PDF invoice.', pop:true },
  { id:'quotation-generator',      icon:'file-text',       tone:'teal', cat:'productivity', title:'Quotation Generator',      desc:'Professional quotes, export to PDF.' },
  { id:'certificate-generator',    icon:'award',           tone:'teal', cat:'productivity', title:'Certificate Generator',    desc:'Design & download a certificate.' },
  { id:'payslip-generator',        icon:'receipt',         tone:'teal', cat:'productivity', title:'Payslip Generator',        desc:'Earnings & deductions → PDF payslip.', pop:true },
  { id:'salary-slip-excel',        icon:'sheet',           tone:'teal', cat:'productivity', title:'Salary Slip to Excel',     desc:'Generate a salary slip as .xlsx.' },

  /* ---------- Text ---------- */
  { id:'word-counter',           icon:'whole-word',        tone:'amber', cat:'text', title:'Word Counter',          desc:'Words, characters & reading time.', pop:true },
  { id:'character-counter',      icon:'a-large-small',     tone:'amber', cat:'text', title:'Character Counter',     desc:'Live character & word stats.' },
  { id:'case-converter',         icon:'case-sensitive',    tone:'amber', cat:'text', title:'Case Converter',        desc:'UPPER, lower, Title, camel & more.', pop:true },
  { id:'remove-duplicate-lines', icon:'list-x',            tone:'amber', cat:'text', title:'Remove Duplicate Lines',desc:'Strip repeated lines instantly.' },
  { id:'remove-extra-spaces',    icon:'remove-formatting', tone:'amber', cat:'text', title:'Remove Extra Spaces',   desc:'Clean up messy whitespace.' },
  { id:'reverse-text',           icon:'arrow-left-right',  tone:'amber', cat:'text', title:'Reverse Text',          desc:'Flip characters, words or lines.' },
  { id:'slug-generator',         icon:'link',              tone:'amber', cat:'text', title:'Slug Generator',        desc:'SEO-friendly URL slugs.' },
  { id:'reading-time',           icon:'book-open',         tone:'amber', cat:'text', title:'Reading Time',          desc:'Estimate minutes to read.' },
  { id:'lorem-ipsum',            icon:'pilcrow',           tone:'amber', cat:'text', title:'Lorem Ipsum',           desc:'Placeholder text on demand.' },
  { id:'random-text',            icon:'shuffle',           tone:'amber', cat:'text', title:'Random Generator',      desc:'Random words, strings & numbers.' },

  /* ---------- Developer ---------- */
  { id:'json-formatter', icon:'braces',       tone:'blue', cat:'dev', title:'JSON Formatter', desc:'Beautify, indent & minify JSON.', pop:true },
  { id:'json-validator', icon:'circle-check', tone:'blue', cat:'dev', title:'JSON Validator', desc:'Validate JSON & see errors.' },
  { id:'xml-formatter',  icon:'code-xml',     tone:'blue', cat:'dev', title:'XML Formatter',  desc:'Pretty-print XML documents.' },
  { id:'html-formatter', icon:'code',         tone:'blue', cat:'dev', title:'HTML Formatter', desc:'Indent & tidy HTML markup.' },
  { id:'css-minifier',   icon:'file-code',    tone:'blue', cat:'dev', title:'CSS Minifier',   desc:'Shrink CSS for production.' },
  { id:'js-minifier',    icon:'code-2',       tone:'blue', cat:'dev', title:'JS Minifier',    desc:'Strip comments & whitespace.' },
  { id:'base64',         icon:'binary',       tone:'blue', cat:'dev', title:'Base64 Encode/Decode', desc:'Convert text ↔ Base64.' },
  { id:'url-encode',     icon:'link-2',       tone:'blue', cat:'dev', title:'URL Encode/Decode', desc:'Encode & decode URLs.' },
  { id:'uuid-generator', icon:'fingerprint',  tone:'blue', cat:'dev', title:'UUID Generator', desc:'Random v4 UUIDs in bulk.' },
  { id:'regex-tester',   icon:'regex',        tone:'blue', cat:'dev', title:'Regex Tester',   desc:'Live match highlighting.', pop:true },
  { id:'json-beautifier', icon:'braces',      tone:'blue', cat:'dev', title:'JSON Beautifier', desc:'Pretty-print JSON.' },
  { id:'json-minifier',  icon:'braces',       tone:'blue', cat:'dev', title:'JSON Minifier',  desc:'Compact JSON to one line.' },
  { id:'xml-validator',  icon:'circle-check', tone:'blue', cat:'dev', title:'XML Validator',  desc:'Check XML is well-formed.' },
  { id:'html-minifier',  icon:'code',         tone:'blue', cat:'dev', title:'HTML Minifier',  desc:'Shrink HTML for production.' },
  { id:'html-beautifier',icon:'code',         tone:'blue', cat:'dev', title:'HTML Beautifier', desc:'Indent & tidy HTML.' },
  { id:'css-beautifier', icon:'file-code',    tone:'blue', cat:'dev', title:'CSS Beautifier', desc:'Format & indent CSS.' },
  { id:'js-beautifier',  icon:'code-2',       tone:'blue', cat:'dev', title:'JS Beautifier',  desc:'Format & indent JavaScript.' },
  { id:'sql-formatter',  icon:'database',     tone:'blue', cat:'dev', title:'SQL Formatter',  desc:'Pretty-print SQL queries.', pop:true },
  { id:'markdown-preview', icon:'file-code',  tone:'blue', cat:'dev', title:'Markdown Preview', desc:'Live Markdown → HTML.' },
  { id:'md5-generator',  icon:'hash',         tone:'blue', cat:'dev', title:'MD5 Generator',  desc:'MD5 hash of any text.' },
  { id:'sha1-generator', icon:'hash',         tone:'blue', cat:'dev', title:'SHA1 Generator', desc:'SHA-1 hash of any text.' },
  { id:'sha256-generator',icon:'hash',        tone:'blue', cat:'dev', title:'SHA256 Generator', desc:'SHA-256 hash of any text.' },
  { id:'base64-encoder', icon:'binary',       tone:'blue', cat:'dev', title:'Base64 Encoder', desc:'Text → Base64.' },
  { id:'base64-decoder', icon:'binary',       tone:'blue', cat:'dev', title:'Base64 Decoder', desc:'Base64 → text.' },
  { id:'url-encoder',    icon:'link-2',       tone:'blue', cat:'dev', title:'URL Encoder',    desc:'Percent-encode text.' },
  { id:'url-decoder',    icon:'link-2',       tone:'blue', cat:'dev', title:'URL Decoder',    desc:'Decode percent-encoding.' },
  { id:'jwt-encoder',    icon:'key-round',    tone:'blue', cat:'dev', title:'JWT Encoder',    desc:'Sign a JWT (HMAC).' },
  { id:'password-strength', icon:'shield-check', tone:'blue', cat:'dev', title:'Password Strength', desc:'Entropy & crack-time check.' },
  { id:'diff-checker',   icon:'git-compare',  tone:'blue', cat:'dev', title:'Diff Checker',   desc:'Compare two texts line by line.', pop:true },
  { id:'cron-expression-generator', icon:'clock', tone:'blue', cat:'dev', title:'Cron Expression Generator', desc:'Build & explain cron schedules.', pop:true },
  { id:'htaccess-generator', icon:'server',   tone:'blue', cat:'dev', title:'.htaccess Generator', desc:'Apache rules: HTTPS, cache, gzip.' },
  { id:'nginx-config-generator', icon:'server-cog', tone:'blue', cat:'dev', title:'Nginx Config Generator', desc:'Server blocks with SSL & proxy.' },
  { id:'docker-compose-generator', icon:'container', tone:'blue', cat:'dev', title:'Docker Compose Generator', desc:'Build a docker-compose.yml.' },
  { id:'env-file-generator', icon:'file-key', tone:'blue', cat:'dev', title:'.env File Generator', desc:'Normalize keys into a .env file.' },
  { id:'json-compare-tool', icon:'git-compare', tone:'blue', cat:'dev', title:'JSON Compare Tool', desc:'Deep-diff two JSON objects.' },
  { id:'csv-diff-checker', icon:'table',       tone:'blue', cat:'dev', title:'CSV Diff Checker', desc:'Row-level added/removed diff.' },

  /* ---------- Calculators ---------- */
  { id:'emi-calc',        icon:'calculator',    tone:'sky', cat:'calc', title:'EMI Calculator',        desc:'Monthly loan payments.', pop:true },
  { id:'loan-calc',       icon:'landmark',      tone:'sky', cat:'calc', title:'Loan Calculator',       desc:'Interest & total payable.' },
  { id:'gst-calc',        icon:'receipt',       tone:'sky', cat:'calc', title:'GST Calculator',        desc:'Add or remove GST/VAT.' },
  { id:'sip-calc',        icon:'trending-up',   tone:'sky', cat:'calc', title:'SIP Calculator',        desc:'Project investment growth.' },
  { id:'bmi-calc',        icon:'scale',         tone:'sky', cat:'calc', title:'BMI Calculator',        desc:'Body-mass index & category.' },
  { id:'age-calc',        icon:'cake',          tone:'sky', cat:'calc', title:'Age Calculator',        desc:'Exact age from a birthdate.' },
  { id:'percentage-calc', icon:'percent',       tone:'sky', cat:'calc', title:'Percentage Calculator', desc:'Every percentage problem.' },
  { id:'discount-calc',   icon:'badge-percent', tone:'sky', cat:'calc', title:'Discount Calculator',   desc:'Sale price & savings.' },
  { id:'currency-calc',   icon:'banknote',      tone:'sky', cat:'calc', title:'Currency Converter',    desc:'Convert with a manual rate.' },

  /* ---------- SEO ---------- */
  { id:'meta-generator',    icon:'tags',     tone:'teal', cat:'seo', title:'Meta Tag Generator',  desc:'Title, description & robots.' },
  { id:'og-generator',      icon:'share-2',  tone:'teal', cat:'seo', title:'Open Graph Generator',desc:'Rich social link previews.' },
  { id:'schema-generator',  icon:'braces',   tone:'teal', cat:'seo', title:'Schema Generator',    desc:'JSON-LD structured data.' },
  { id:'robots-generator',  icon:'bot',      tone:'teal', cat:'seo', title:'Robots.txt Generator',desc:'Crawler rules in seconds.' },
  { id:'sitemap-generator', icon:'network',  tone:'teal', cat:'seo', title:'Sitemap Generator',   desc:'XML sitemap from URLs.' },
  { id:'serp-preview',      icon:'search',   tone:'teal', cat:'seo', title:'SERP Preview',        desc:'See your Google snippet.' },
  { id:'faq-schema-generator',     icon:'circle-help', tone:'teal', cat:'seo', title:'FAQ Schema Generator',     desc:'FAQPage JSON-LD for rich results.', pop:true },
  { id:'product-schema-generator', icon:'package',     tone:'teal', cat:'seo', title:'Product Schema Generator', desc:'Product + offer + rating JSON-LD.' },
  { id:'article-schema-generator', icon:'newspaper',   tone:'teal', cat:'seo', title:'Article Schema Generator', desc:'Article JSON-LD for news/blogs.' },
  { id:'faq-jsonld-validator',     icon:'check-check', tone:'teal', cat:'seo', title:'JSON-LD Validator',        desc:'Validate schema markup.' },
  { id:'robots-txt-tester',        icon:'bot',         tone:'teal', cat:'seo', title:'Robots.txt Tester',        desc:'Test if a path is crawlable.' },
  { id:'sitemap-validator',        icon:'network',     tone:'teal', cat:'seo', title:'Sitemap Validator',        desc:'Check sitemap XML for errors.' },
  { id:'meta-tag-analyzer',        icon:'scan-search', tone:'teal', cat:'seo', title:'Meta Tag Analyzer',        desc:'Audit a page\u2019s SEO meta tags.', pop:true },
  { id:'page-speed-checklist',     icon:'gauge',       tone:'teal', cat:'seo', title:'Page Speed Checklist',     desc:'Track Core Web Vitals fixes.' },
  { id:'seo-audit-checklist',      icon:'list-checks', tone:'teal', cat:'seo', title:'SEO Audit Checklist',      desc:'On-page, technical & off-page.' },

  /* ---------- Social ---------- */
  { id:'hashtag-generator', icon:'hash',                tone:'amber', cat:'social', title:'Hashtag Generator', desc:'Tags for any topic.' },
  { id:'bio-generator',     icon:'user-round',          tone:'amber', cat:'social', title:'Bio Generator',     desc:'Profile bios that pop.' },
  { id:'caption-generator', icon:'message-square-text', tone:'amber', cat:'social', title:'Caption Generator', desc:'Captions in your tone.' },
  { id:'youtube-title',     icon:'youtube',             tone:'amber', cat:'social', title:'YouTube Title Ideas', desc:'Click-worthy video titles.' },
  { id:'linkedin-formatter',icon:'linkedin',            tone:'amber', cat:'social', title:'LinkedIn Formatter', desc:'Clean, readable posts.' },
  { id:'youtube-title-analyzer',   icon:'youtube',      tone:'amber', cat:'social', title:'YouTube Title Analyzer', desc:'Score & improve your title.', pop:true },
  { id:'youtube-description-formatter', icon:'align-left', tone:'amber', cat:'social', title:'YouTube Description Formatter', desc:'Timestamps, links & tags.' },
  { id:'instagram-hashtag-analyzer', icon:'hash',       tone:'amber', cat:'social', title:'Instagram Hashtag Analyzer', desc:'Audit your hashtag mix.' },
  { id:'linkedin-headline-generator', icon:'user-round', tone:'amber', cat:'social', title:'LinkedIn Headline Generator', desc:'6 headline options.' },
  { id:'twitter-bio-generator',    icon:'twitter',      tone:'amber', cat:'social', title:'X (Twitter) Bio Generator', desc:'Bios with live char count.' },
  { id:'tiktok-username-generator', icon:'at-sign',     tone:'amber', cat:'social', title:'TikTok Username Generator', desc:'Handle ideas, click to copy.' },

  /* ---------- Color & CSS ---------- */
  { id:'color-picker', icon:'pipette',    tone:'green', cat:'color', title:'Color Picker', desc:'Pick & convert HEX/RGB/HSL.', pop:true },
  { id:'gradient-gen', icon:'blend',      tone:'green', cat:'color', title:'Gradient Generator', desc:'CSS gradients, copy-ready.' },
  { id:'shadow-gen',   icon:'box',        tone:'blue',  cat:'web',   title:'Box Shadow Generator', desc:'Layered CSS shadows.' },
  { id:'glass-gen',    icon:'layers',     tone:'blue',  cat:'web',   title:'Glassmorphism CSS', desc:'Frosted-glass effect.' },

  /* ---------- Security & Utilities ---------- */
  { id:'password-gen',        icon:'key-round',    tone:'red', cat:'security', title:'Password Generator', desc:'Strong, random, secure.', pop:true },
  { id:'hash-generator',      icon:'shield-check', tone:'red', cat:'security', title:'Hash Generator',     desc:'SHA-1 · SHA-256 · SHA-512.' },
  { id:'caesar-cipher',       icon:'lock-keyhole', tone:'red', cat:'security', title:'Caesar Cipher',      desc:'Classic shift encryption.' },
  { id:'jwt-decoder',         icon:'file-key',     tone:'red', cat:'security', title:'JWT Decoder',        desc:'Inspect token header & payload.' },
  { id:'qr-generator',        icon:'qr-code',      tone:'sky', cat:'util',     title:'QR Code Generator',  desc:'Custom QR codes, no limits.', pop:true },
  { id:'timestamp-converter', icon:'clock',        tone:'sky', cat:'util',     title:'Timestamp Converter',desc:'Unix ↔ human dates.' },
  { id:'bulk-qr-generator',   icon:'qr-code',      tone:'sky', cat:'util',     title:'Bulk QR Generator',  desc:'Many QR codes at once → ZIP.', pop:true },
  { id:'wifi-qr-generator',   icon:'wifi',         tone:'sky', cat:'util',     title:'Wi-Fi QR Generator', desc:'Share Wi-Fi with a scan.' },
  { id:'business-card-qr-generator', icon:'contact', tone:'sky', cat:'util',  title:'Business Card QR',   desc:'vCard contact QR code.' },
  { id:'uuid-bulk-generator', icon:'fingerprint',  tone:'sky', cat:'util',     title:'UUID Bulk Generator',desc:'Hundreds of UUIDs, any format.' },
  { id:'secure-passphrase-generator', icon:'key-round', tone:'sky', cat:'util', title:'Passphrase Generator', desc:'Memorable, high-entropy phrases.' },
  { id:'random-data-generator', icon:'database',   tone:'sky', cat:'util',     title:'Random Data Generator', desc:'Fake test data: CSV/JSON/SQL.' },

  /* ---------- Converters ---------- */
  { id:'length-converter',      icon:'ruler',         tone:'sky', cat:'convert', title:'Length Converter',      desc:'Meters, miles, feet & more.', pop:true },
  { id:'weight-converter',      icon:'scale',         tone:'sky', cat:'convert', title:'Weight Converter',      desc:'Kg, lb, oz, tonnes…' },
  { id:'temperature-converter', icon:'thermometer',   tone:'sky', cat:'convert', title:'Temperature Converter', desc:'Celsius, Fahrenheit, Kelvin.' },
  { id:'area-converter',        icon:'square',        tone:'sky', cat:'convert', title:'Area Converter',        desc:'Sq m, acres, hectares…' },
  { id:'volume-converter',      icon:'beaker',        tone:'sky', cat:'convert', title:'Volume Converter',      desc:'Liters, gallons, cups…' },
  { id:'speed-converter',       icon:'gauge',         tone:'sky', cat:'convert', title:'Speed Converter',       desc:'km/h, mph, knots…' },
  { id:'time-converter',        icon:'timer',         tone:'sky', cat:'convert', title:'Time Converter',        desc:'Seconds to years.' },
  { id:'data-converter',        icon:'database',      tone:'sky', cat:'convert', title:'Data Size Converter',   desc:'Bytes, KB, MB, GB, TB.' },
  { id:'base-converter',        icon:'binary',        tone:'sky', cat:'convert', title:'Number Base Converter', desc:'Dec · Bin · Oct · Hex.' },
  { id:'roman-numerals',        icon:'columns-3',     tone:'sky', cat:'convert', title:'Roman Numerals',        desc:'Number ↔ Roman numeral.' },
  { id:'number-to-words',       icon:'spell-check',   tone:'sky', cat:'convert', title:'Number to Words',       desc:'12345 → twelve thousand…' },

  /* ---------- More Text ---------- */
  { id:'sort-lines',         icon:'arrow-down-up',    tone:'amber', cat:'text', title:'Sort Lines',          desc:'A–Z, Z–A, length or numeric.' },
  { id:'find-replace',       icon:'replace',          tone:'amber', cat:'text', title:'Find & Replace',      desc:'Bulk replace in text.' },
  { id:'remove-line-breaks', icon:'wrap-text',        tone:'amber', cat:'text', title:'Remove Line Breaks',  desc:'Join lines into one block.' },
  { id:'add-line-numbers',   icon:'list-ordered',     tone:'amber', cat:'text', title:'Add Line Numbers',    desc:'Prefix each line with a number.' },
  { id:'word-frequency',     icon:'chart-no-axes-column', tone:'amber', cat:'text', title:'Word Frequency', desc:'Count most-used words.' },
  { id:'extract-emails',     icon:'at-sign',          tone:'amber', cat:'text', title:'Extract Emails',      desc:'Pull emails from any text.' },
  { id:'extract-urls',       icon:'link',             tone:'amber', cat:'text', title:'Extract URLs',        desc:'Pull links from any text.' },
  { id:'remove-punctuation', icon:'eraser',           tone:'amber', cat:'text', title:'Remove Punctuation',  desc:'Strip all punctuation marks.' },
  { id:'repeat-text',        icon:'repeat-2',         tone:'amber', cat:'text', title:'Repeat Text',         desc:'Duplicate text N times.' },
  { id:'text-binary',        icon:'binary',           tone:'amber', cat:'text', title:'Text ↔ Binary',       desc:'Encode & decode binary.' },
  { id:'morse-code',         icon:'radio',            tone:'amber', cat:'text', title:'Morse Code',          desc:'Translate text ↔ Morse.' },
  { id:'rot13',              icon:'rotate-3d',        tone:'amber', cat:'text', title:'ROT13 Encoder',       desc:'Classic letter rotation.' },
  { id:'upside-down',        icon:'flip-vertical',    tone:'amber', cat:'text', title:'Upside Down Text',    desc:'Flip text ¡ǝpᴉsdn.' },
  { id:'fancy-text',         icon:'sparkles',         tone:'amber', cat:'text', title:'Fancy Text',          desc:'𝐁𝐨𝐥𝐝, 𝓼𝓬𝓻𝓲𝓹𝓽 & more.' },
  { id:'count-occurrences',  icon:'search-check',     tone:'amber', cat:'text', title:'Count Occurrences',   desc:'Count a word or phrase.' },

  /* ---------- More Calculators ---------- */
  { id:'tip-calc',          icon:'hand-coins',     tone:'sky', cat:'calc', title:'Tip Calculator',         desc:'Tip & split the bill.' },
  { id:'simple-interest',   icon:'percent',        tone:'sky', cat:'calc', title:'Simple Interest',        desc:'Principal × rate × time.' },
  { id:'compound-interest', icon:'trending-up',    tone:'sky', cat:'calc', title:'Compound Interest',      desc:'Growth with compounding.' },
  { id:'aspect-ratio',      icon:'ratio',          tone:'sky', cat:'calc', title:'Aspect Ratio',           desc:'Resize keeping proportions.' },
  { id:'fuel-cost',         icon:'fuel',           tone:'sky', cat:'calc', title:'Fuel Cost Calculator',   desc:'Trip fuel & cost estimate.' },
  { id:'average-calc',      icon:'sigma',          tone:'sky', cat:'calc', title:'Average / Mean',         desc:'Mean, median, min & max.' },
  { id:'date-diff',         icon:'calendar-days',  tone:'sky', cat:'calc', title:'Date Difference',        desc:'Days between two dates.' },
  { id:'random-number',     icon:'dices',          tone:'sky', cat:'calc', title:'Random Number',          desc:'Random numbers in a range.' },
  { id:'dice-roller',       icon:'dice-5',         tone:'sky', cat:'calc', title:'Dice Roller',            desc:'Roll any number of dice.' },
  { id:'fd-calculator',     icon:'piggy-bank',     tone:'sky', cat:'calc', title:'FD Calculator',          desc:'Fixed-deposit maturity value.', pop:true },
  { id:'rd-calculator',     icon:'piggy-bank',     tone:'sky', cat:'calc', title:'RD Calculator',          desc:'Recurring-deposit returns.' },
  { id:'loan-amortization-calculator', icon:'table', tone:'sky', cat:'calc', title:'Loan Amortization',    desc:'Full repayment schedule + CSV.', pop:true },
  { id:'break-even-calculator', icon:'trending-up', tone:'sky', cat:'calc', title:'Break-even Calculator', desc:'Units to sell before profit.' },
  { id:'income-tax-calculator', icon:'landmark',   tone:'sky', cat:'calc', title:'Income Tax Calculator',  desc:'US / India / UK estimate.' },
  { id:'gst-invoice-generator', icon:'receipt',    tone:'sky', cat:'calc', title:'GST Invoice Generator',  desc:'CGST/SGST/IGST invoice → PDF.' },
  { id:'cgpa-calculator',   icon:'graduation-cap', tone:'sky', cat:'calc', title:'CGPA Calculator',        desc:'10-point, credit-weighted.' },
  { id:'gpa-calculator',    icon:'graduation-cap', tone:'sky', cat:'calc', title:'GPA Calculator',         desc:'4.0 scale, credit-weighted.' },
  { id:'attendance-calculator', icon:'calendar-check', tone:'sky', cat:'calc', title:'Attendance Calculator', desc:'Can you skip a class?' },
  { id:'percent-to-gpa-converter', icon:'percent', tone:'sky', cat:'calc', title:'Percentage to GPA',      desc:'Convert % to a 4/10 GPA.' },
  { id:'study-timetable-generator', icon:'calendar-clock', tone:'sky', cat:'calc', title:'Study Timetable Generator', desc:'Weekly study plan + CSV.' },

  /* ---------- More Color / CSS ---------- */
  { id:'contrast-checker', icon:'contrast',  tone:'green', cat:'color', title:'Contrast Checker', desc:'WCAG AA/AAA pass check.' },
  { id:'random-color',     icon:'shuffle',   tone:'green', cat:'color', title:'Random Color',     desc:'Generate random HEX colors.' },
  { id:'hex-rgb',          icon:'pipette',   tone:'green', cat:'color', title:'HEX ↔ RGB',        desc:'Convert color formats.' },

  /* ---------- More Developer / Data ---------- */
  { id:'html-entities', icon:'code',        tone:'blue', cat:'dev', title:'HTML Entities',  desc:'Encode & decode entities.' },
  { id:'json-to-csv',   icon:'table',       tone:'blue', cat:'dev', title:'JSON to CSV',    desc:'Flatten JSON into CSV.' },
  { id:'csv-to-json',   icon:'braces',      tone:'blue', cat:'dev', title:'CSV to JSON',    desc:'Parse CSV into JSON.' },

  /* ---------- Office / document conversions ---------- */
  { id:'word-to-pdf',   icon:'file-text',  tone:'sky', cat:'office', title:'Word to PDF',   desc:'.docx → formatted PDF.', pop:true },
  { id:'excel-to-pdf',  icon:'sheet',      tone:'sky', cat:'office', title:'Excel to PDF',  desc:'.xlsx / .csv → PDF table.' },
  { id:'html-to-pdf',   icon:'code-2',     tone:'sky', cat:'office', title:'HTML to PDF',   desc:'Render HTML to a PDF.' },
  { id:'pdf-to-word',   icon:'file-output',tone:'sky', cat:'office', title:'PDF to Word',   desc:'Extract text to .doc.' },
  { id:'word-to-html',  icon:'file-code',  tone:'sky', cat:'office', title:'Word to HTML',  desc:'.docx → clean HTML.' },
  { id:'excel-to-json', icon:'braces',     tone:'sky', cat:'office', title:'Excel to JSON', desc:'.xlsx / .csv → JSON.' },
  { id:'json-to-excel', icon:'table',      tone:'sky', cat:'office', title:'JSON to Excel', desc:'JSON → .xlsx workbook.' },
  { id:'csv-to-excel',  icon:'file-spreadsheet', tone:'sky', cat:'office', title:'CSV to Excel', desc:'.csv → .xlsx workbook.' },
  { id:'excel-to-csv',  icon:'download',    tone:'sky', cat:'office', title:'Excel to CSV',  desc:'.xlsx / .ods → CSV.' },
  { id:'xml-to-excel',  icon:'table',       tone:'sky', cat:'office', title:'XML to Excel',  desc:'XML records → .xlsx.' },
  { id:'word-viewer',   icon:'file-text',   tone:'sky', cat:'office', title:'Word Viewer',   desc:'Open & read a .docx.', pop:true },
  { id:'excel-viewer',  icon:'sheet',       tone:'sky', cat:'office', title:'Excel Viewer',  desc:'Browse .xlsx sheets.', pop:true },
  { id:'csv-viewer',    icon:'table-2',     tone:'sky', cat:'office', title:'CSV Viewer',    desc:'View & export CSV.' },
  { id:'spreadsheet-viewer', icon:'sheet',  tone:'sky', cat:'office', title:'Spreadsheet Viewer', desc:'XLSX · CSV · ODS.' },
  { id:'ods-viewer',    icon:'sheet',       tone:'sky', cat:'office', title:'ODS Viewer',    desc:'Open OpenDocument sheets.' },
  { id:'odt-viewer',    icon:'file-text',   tone:'sky', cat:'office', title:'ODT Viewer',    desc:'Read OpenDocument text.' },
  { id:'powerpoint-viewer', icon:'presentation', tone:'sky', cat:'office', title:'PowerPoint Viewer', desc:'Extract slide text (.pptx).' },
  { id:'spreadsheet-merger', icon:'combine', tone:'sky', cat:'office', title:'Spreadsheet Merger', desc:'Merge files into one workbook.' },
  { id:'spreadsheet-splitter', icon:'split', tone:'sky', cat:'office', title:'Spreadsheet Splitter', desc:'Split each sheet to its own file.' },
  { id:'text-to-word',  icon:'file-output', tone:'sky', cat:'office', title:'Text to Word',  desc:'Plain text → .doc file.' },
  { id:'rtf-converter', icon:'file-type',   tone:'sky', cat:'office', title:'RTF Converter', desc:'Text ↔ RTF, both ways.' },
  { id:'docx-converter', icon:'file-text',  tone:'sky', cat:'office', title:'DOCX Converter', desc:'PDF, HTML, viewer & more.' },
  { id:'xlsx-converter', icon:'sheet',      tone:'sky', cat:'office', title:'XLSX Converter', desc:'PDF, CSV, JSON & viewer.' },
  { id:'pptx-converter', icon:'presentation', tone:'sky', cat:'office', title:'PPTX Converter', desc:'View & extract slide text.' },
  { id:'markdown-html', icon:'file-code',   tone:'blue', cat:'dev', title:'Markdown to HTML', desc:'Render Markdown to HTML.' },

  /* ---------- Agriculture ---------- */
  { id:'crop-profit-calculator',        icon:'sprout',        tone:'teal', cat:'agri', title:'Crop Profit Calculator',    desc:'Revenue, cost & profit per acre.', pop:true },
  { id:'fertilizer-requirement-calculator', icon:'flask-conical', tone:'teal', cat:'agri', title:'Fertilizer Requirement', desc:'Urea, DAP & MOP from NPK target.' },
  { id:'seed-rate-calculator',          icon:'wheat',         tone:'teal', cat:'agri', title:'Seed Rate Calculator',      desc:'Seed needed by germination %.' },
  { id:'paddy-yield-calculator',        icon:'wheat',         tone:'teal', cat:'agri', title:'Paddy Yield Calculator',    desc:'Crop-cut yield estimate.' },
  { id:'tractor-emi-calculator',        icon:'tractor',       tone:'teal', cat:'agri', title:'Tractor EMI Calculator',    desc:'Loan EMI + yearly breakdown.', pop:true },
  { id:'irrigation-water-calculator',   icon:'droplets',      tone:'teal', cat:'agri', title:'Irrigation Water Calculator', desc:'Water volume & pumping time.' },
  { id:'farm-expense-tracker',          icon:'notebook-pen',  tone:'teal', cat:'agri', title:'Farm Expense Tracker',      desc:'Log costs, totals by category.' },

  /* ---------- Vehicle ---------- */
  { id:'bike-emi-calculator',   icon:'bike',         tone:'sky', cat:'vehicle', title:'Bike EMI Calculator',   desc:'Two-wheeler loan EMI + schedule.', pop:true },
  { id:'car-emi-calculator',    icon:'car',          tone:'sky', cat:'vehicle', title:'Car EMI Calculator',    desc:'Car loan EMI + yearly breakdown.', pop:true },
  { id:'fuel-cost-calculator',  icon:'fuel',         tone:'sky', cat:'vehicle', title:'Fuel Cost Calculator',  desc:'Trip & running fuel cost.' },
  { id:'mileage-calculator',    icon:'gauge',        tone:'sky', cat:'vehicle', title:'Mileage Calculator',    desc:'km/L from fuel or odometer.' },
  { id:'tyre-size-calculator',  icon:'circle-dot',   tone:'sky', cat:'vehicle', title:'Tyre Size Calculator',  desc:'Compare sizes & speedo error.' },
  { id:'engine-cc-comparison',  icon:'cog',          tone:'sky', cat:'vehicle', title:'Engine CC Comparison',  desc:'Power-to-weight & specific output.' },
  { id:'vehicle-service-cost-estimator', icon:'wrench', tone:'sky', cat:'vehicle', title:'Service Cost Estimator', desc:'Estimate a service bill.' },
  { id:'vehicle-specification-comparison', icon:'columns-3', tone:'sky', cat:'vehicle', title:'Spec Comparison', desc:'Compare two vehicles side by side.' },
];

const FTH_CATS = [
  { id:'pdf',      label:'PDF',         icon:'file-text',   tone:'red'   },
  { id:'image',    label:'Image',       icon:'image',       tone:'green' },
  { id:'productivity', label:'Productivity', icon:'rocket',  tone:'teal'  },
  { id:'text',     label:'Text',        icon:'type',        tone:'amber' },
  { id:'dev',      label:'Developer',   icon:'code',        tone:'blue'  },
  { id:'calc',     label:'Calculators', icon:'calculator',  tone:'sky'   },
  { id:'seo',      label:'SEO',         icon:'trending-up', tone:'teal'  },
  { id:'office',   label:'Office',      icon:'briefcase',   tone:'sky'   },
  { id:'social',   label:'Social',      icon:'share-2',     tone:'amber' },
  { id:'color',    label:'Color',       icon:'palette',     tone:'green' },
  { id:'web',      label:'Website/CSS', icon:'layout',      tone:'blue'  },
  { id:'convert',  label:'Converters',  icon:'arrow-right-left', tone:'sky' },
  { id:'security', label:'Security',    icon:'shield',      tone:'red'   },
  { id:'util',     label:'Utilities',   icon:'wrench',      tone:'sky'   },
  { id:'agri',     label:'Agriculture', icon:'sprout',      tone:'teal'  },
  { id:'vehicle',  label:'Vehicle',     icon:'car',         tone:'sky'   },
];

const TONE_MAP = {
  blue:['var(--blue-50)','var(--blue-600)'], sky:['var(--sky-50)','var(--sky-600)'],
  teal:['var(--teal-50)','var(--teal-600)'], green:['var(--green-50)','var(--green-600)'],
  amber:['var(--amber-50)','var(--amber-600)'], red:['var(--red-50)','var(--red-600)'],
};

window.FTH = {
  TOOLS: FTH_TOOLS,
  CATS: FTH_CATS,
  TONE_MAP,
  byId: (id) => FTH_TOOLS.find(t => t.id === id) || FTH_TOOLS[0],
  catLabel: (id) => (FTH_CATS.find(c => c.id === id) || {}).label || id,
  working: FTH_TOOLS,
  popular: FTH_TOOLS.filter(t => t.pop),
  count: FTH_TOOLS.length,
};
