
 /* =========================================
           TOOL PAGE — matches Toolbil design system
           ========================================= */

        /* ---- Tool Hero ---- */
        .tool-hero {
            
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            padding:140px 0 80px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        .tool-hero::before {
            content: '';
            position: absolute;
            inset: 0;
            background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
        }
        .tool-hero .container { position: relative; z-index: 1; }
        .tool-hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: rgba(229, 57, 53, 0.2);
            border: 1px solid rgba(229, 57, 53, 0.4);
            color: #ff8a80;
            font-family: 'Poppins', sans-serif;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            padding: 6px 16px;
            border-radius: 50px;
            margin-bottom: 20px;
        }
        .tool-hero h1 {
            font-family: 'Poppins', sans-serif;
            font-size: clamp(26px, 5vw, 42px);
            font-weight: 800;
            color: #ffffff;
            line-height: 1.2;
            margin-bottom: 16px;
        }
        .tool-hero h1 span { color: #ef5350; }
        .tool-hero p {
            font-family: 'Inter', sans-serif;
            font-size: 16px;
            color: rgba(255,255,255,0.7);
            max-width: 600px;
            margin: 0 auto 28px;
            line-height: 1.7;
        }
        .tool-hero-stats {
            display: flex;
            justify-content: center;
            gap: 32px;
            flex-wrap: wrap;
        }
        .tool-hero-stat {
            text-align: center;
        }
        .tool-hero-stat strong {
            display: block;
            font-family: 'Poppins', sans-serif;
            font-size: 22px;
            font-weight: 700;
            color: #ef5350;
        }
        .tool-hero-stat span {
            font-family: 'Inter', sans-serif;
            font-size: 12px;
            color: rgba(255,255,255,0.55);
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        /* ---- Tool Section Layout ---- */
        .tool-section {
            padding: 50px 0 60px;
            background: var(--bg-primary, #f8f9fa);
        }
        .tool-wrapper {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 28px;
            align-items: start;
        }
        @media (max-width: 900px) {
            .tool-wrapper { grid-template-columns: 1fr; }
        }

        /* ---- Cards ---- */
        .tool-card {
            background: #ffffff;
            border-radius: 16px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.07);
            overflow: hidden;
        }
        .tool-card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 18px 22px;
            border-bottom: 1px solid #f0f0f0;
            background: #fafafa;
        }
        .tool-card-header h2 {
            font-family: 'Poppins', sans-serif;
            font-size: 15px;
            font-weight: 600;
            color: #1a1a2e;
            margin: 0;
        }
        .tool-card-header .card-icon {
            width: 32px; height: 32px;
            background: linear-gradient(135deg, #ef5350, #b71c1c);
            border-radius: 8px;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .tool-card-header .card-icon i { color: #fff; font-size: 14px; }
        .tool-card-body { padding: 22px; }

        /* ---- Form Fields ---- */
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
            margin-bottom: 14px;
        }
        .form-row.single { grid-template-columns: 1fr; }
        @media (max-width: 540px) {
            .form-row { grid-template-columns: 1fr; }
        }
        .form-group { display: flex; flex-direction: column; gap: 6px; }
        .form-group label {
            font-family: 'Inter', sans-serif;
            font-size: 12px;
            font-weight: 600;
            color: #555;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .form-group input,
        .form-group select,
        .form-group textarea {
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            color: #1a1a2e;
            background: #f8f9fa;
            border: 1.5px solid #e8e8e8;
            border-radius: 10px;
            padding: 10px 14px;
            outline: none;
            width: 100%;
            transition: border-color 0.2s, box-shadow 0.2s;
            box-sizing: border-box;
        }
        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            border-color: #ef5350;
            background: #fff;
            box-shadow: 0 0 0 3px rgba(239,83,80,0.1);
        }
        .form-group textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

        /* ---- Tone Selector ---- */
        .tone-label {
            font-family: 'Inter', sans-serif;
            font-size: 12px;
            font-weight: 600;
            color: #555;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 8px;
            display: block;
        }
        .tone-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 14px;
        }
        @media (max-width: 420px) { .tone-grid { grid-template-columns: 1fr 1fr; } }
        .tone-chip {
            padding: 8px 4px;
            font-family: 'Inter', sans-serif;
            font-size: 11.5px;
            font-weight: 500;
            border: 1.5px solid #e8e8e8;
            border-radius: 8px;
            background: #f8f9fa;
            color: #666;
            cursor: pointer;
            text-align: center;
            transition: all 0.18s;
            line-height: 1.3;
        }
        .tone-chip:hover { border-color: #ef5350; color: #ef5350; background: #fff5f5; }
        .tone-chip.active {
            border-color: #ef5350;
            background: #fff5f5;
            color: #c62828;
            font-weight: 600;
        }

        /* ---- Generate Button ---- */
        .btn-generate {
            width: 100%;
            padding: 14px 20px;
            font-family: 'Poppins', sans-serif;
            font-size: 15px;
            font-weight: 700;
            background: linear-gradient(135deg, #ef5350, #b71c1c);
            color: #ffffff;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.2s;
            box-shadow: 0 4px 15px rgba(239,83,80,0.35);
            margin-top: 6px;
        }
        .btn-generate:hover {
            background: linear-gradient(135deg, #e53935, #7f0000);
            box-shadow: 0 6px 20px rgba(239,83,80,0.45);
            transform: translateY(-1px);
        }
        .btn-generate:active { transform: translateY(0); }
        .btn-generate:disabled {
            background: #ccc;
            box-shadow: none;
            cursor: not-allowed;
            transform: none;
        }

        /* ---- Output Panel ---- */
        .output-panel {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .output-placeholder {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 50px 20px;
            text-align: center;
            color: #aaa;
            gap: 14px;
        }
        .output-placeholder i { font-size: 42px; color: #e0e0e0; }
        .output-placeholder p { font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.6; color: #bbb; max-width: 240px; margin: 0; }

        /* ---- Loading ---- */
        .loading-state {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 50px 20px;
            gap: 14px;
        }
        .loading-dots {
            display: flex;
            gap: 8px;
        }
        .loading-dots span {
            width: 10px; height: 10px;
            background: #ef5350;
            border-radius: 50%;
            animation: tbDot 1.2s ease-in-out infinite;
        }
        .loading-dots span:nth-child(2) { animation-delay: 0.2s; }
        .loading-dots span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes tbDot {
            0%, 80%, 100% { opacity: 0.2; transform: scale(0.7); }
            40% { opacity: 1; transform: scale(1); }
        }
        .loading-state p {
            font-family: 'Inter', sans-serif;
            font-size: 13px;
            color: #999;
            animation: fadeText 2s ease-in-out infinite;
        }
        @keyframes fadeText { 0%,100%{opacity:.5} 50%{opacity:1} }

        /* ---- Generated Story ---- */
        .story-output { display: none; }
        .story-output.visible { display: block; }

        .story-title-bar {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }
        .story-generated-title {
            font-family: 'Poppins', sans-serif;
            font-size: 18px;
            font-weight: 700;
            color: #b71c1c;
            line-height: 1.3;
            flex: 1;
        }
        .btn-copy {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 7px 14px;
            font-family: 'Inter', sans-serif;
            font-size: 12px;
            font-weight: 600;
            border: 1.5px solid #e8e8e8;
            border-radius: 8px;
            background: #fff;
            color: #555;
            cursor: pointer;
            transition: all 0.18s;
            flex-shrink: 0;
        }
        .btn-copy:hover { border-color: #ef5350; color: #ef5350; background: #fff5f5; }
        .btn-copy.copied { border-color: #43a047; color: #43a047; background: #f1f8e9; }

        .story-meta {
            display: flex;
            gap: 14px;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }
        .story-meta-tag {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-family: 'Inter', sans-serif;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 4px 10px;
            border-radius: 20px;
            background: #f5f5f5;
            color: #666;
        }
        .story-meta-tag.tone-tag { background: #fff5f5; color: #c62828; }
        .story-meta-tag.words-tag { background: #e8f5e9; color: #2e7d32; }

        .story-body {
            font-family: 'Inter', sans-serif;
            font-size: 15px;
            line-height: 1.85;
            color: #2d2d2d;
            border-left: 3px solid #ef5350;
            padding-left: 18px;
            margin-bottom: 0;
            white-space: pre-wrap;
        }
        .story-body p { margin-bottom: 14px; }
        .story-body p:last-child { margin-bottom: 0; }

        .output-actions {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 8px;
            padding: 16px 22px;
            border-top: 1px solid #f0f0f0;
            background: #fafafa;
        }
        @media (max-width: 480px) { .output-actions { grid-template-columns: 1fr; } }
        .btn-action {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 9px 8px;
            font-family: 'Inter', sans-serif;
            font-size: 12px;
            font-weight: 600;
            border: 1.5px solid #e8e8e8;
            border-radius: 8px;
            background: #fff;
            color: #444;
            cursor: pointer;
            transition: all 0.18s;
            text-align: center;
        }
        .btn-action:hover { border-color: #1a1a2e; color: #1a1a2e; background: #f8f9fa; }
        .btn-action i { font-size: 13px; }

        /* ---- Stats bar ---- */
        .tool-stats-bar {
            display: flex;
            justify-content: center;
            gap: 40px;
            flex-wrap: wrap;
            padding: 24px 0;
            border-top: 1px solid #f0f0f0;
            border-bottom: 1px solid #f0f0f0;
            margin-bottom: 40px;
        }
        .tstat {
            text-align: center;
            font-family: 'Poppins', sans-serif;
        }
        .tstat strong { display: block; font-size: 22px; font-weight: 700; color: #ef5350; }
        .tstat span { font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: 0.05em; }

        /* ---- How It Works ---- */
        .hiw-section { padding: 40px 0; }
        .section-title {
            font-family: 'Poppins', sans-serif;
            font-size: 28px;
            font-weight: 700;
            color: #1a1a2e;
            margin-bottom: 8px;
        }
        .section-sub {
            font-family: 'Inter', sans-serif;
            font-size: 15px;
            color: #666;
            margin-bottom: 32px;
            line-height: 1.6;
        }
        .hiw-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
        }
        @media (max-width: 768px) { .hiw-grid { grid-template-columns: 1fr 1fr; } }
        @media (max-width: 480px) { .hiw-grid { grid-template-columns: 1fr; } }
        .hiw-card {
            text-align: center;
            padding: 28px 16px;
            background: #fff;
            border-radius: 14px;
            box-shadow: 0 2px 16px rgba(0,0,0,0.06);
            position: relative;
        }
        .hiw-num {
            width: 36px; height: 36px;
            background: linear-gradient(135deg, #ef5350, #b71c1c);
            color: #fff;
            font-family: 'Poppins', sans-serif;
            font-size: 16px;
            font-weight: 700;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            margin: 0 auto 14px;
        }
        .hiw-card h3 {
            font-family: 'Poppins', sans-serif;
            font-size: 14px;
            font-weight: 600;
            color: #1a1a2e;
            margin-bottom: 8px;
        }
        .hiw-card p {
            font-family: 'Inter', sans-serif;
            font-size: 13px;
            color: #777;
            line-height: 1.6;
            margin: 0;
        }

        /* ---- Use Cases ---- */
        .usecase-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-top: 32px;
        }
        @media (max-width: 768px) { .usecase-grid { grid-template-columns: 1fr 1fr; } }
        @media (max-width: 480px) { .usecase-grid { grid-template-columns: 1fr; } }
        .usecase-card {
            padding: 22px;
            background: #fff;
            border-radius: 14px;
            border-left: 4px solid #ef5350;
            box-shadow: 0 2px 16px rgba(0,0,0,0.06);
        }
        .usecase-card i {
            font-size: 24px;
            color: #ef5350;
            margin-bottom: 10px;
            display: block;
        }
        .usecase-card h3 {
            font-family: 'Poppins', sans-serif;
            font-size: 15px;
            font-weight: 600;
            color: #1a1a2e;
            margin-bottom: 8px;
        }
        .usecase-card p {
            font-family: 'Inter', sans-serif;
            font-size: 13px;
            color: #666;
            line-height: 1.6;
            margin: 0;
        }

        /* ---- FAQ ---- */
        .faq-section { padding: 50px 0; }
        .faq-list { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
        .faq-item {
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.06);
            overflow: hidden;
        }
        .faq-question {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 22px;
            cursor: pointer;
            gap: 12px;
            transition: background 0.18s;
        }
        .faq-question:hover { background: #fafafa; }
        .faq-question h4 {
            font-family: 'Poppins', sans-serif;
            font-size: 15px;
            font-weight: 600;
            color: #1a1a2e;
            margin: 0;
            flex: 1;
        }
        .faq-question i {
            color: #ef5350;
            font-size: 14px;
            transition: transform 0.25s;
            flex-shrink: 0;
        }
        .faq-question.open i { transform: rotate(180deg); }
        .faq-answer {
            display: none;
            padding: 0 22px 18px;
        }
        .faq-answer.open { display: block; }
        .faq-answer p {
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            color: #555;
            line-height: 1.7;
            margin: 0;
        }

        /* ---- Related Tools ---- */
        .related-section { padding: 40px 0 50px; background: #f8f9fa; }
        .related-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 18px;
            margin-top: 28px;
        }
        @media (max-width: 768px) { .related-grid { grid-template-columns: 1fr 1fr; } }
        @media (max-width: 480px) { .related-grid { grid-template-columns: 1fr; } }
        .related-card {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 18px;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.06);
            text-decoration: none;
            transition: all 0.2s;
        }
        .related-card:hover { box-shadow: 0 4px 20px rgba(239,83,80,0.15); transform: translateY(-2px); }
        .related-icon {
            width: 44px; height: 44px;
            background: linear-gradient(135deg, #ef5350, #b71c1c);
            border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .related-icon i { color: #fff; font-size: 18px; }
        .related-info h4 {
            font-family: 'Poppins', sans-serif;
            font-size: 13px;
            font-weight: 600;
            color: #1a1a2e;
            margin: 0 0 3px;
        }
        .related-info span {
            font-family: 'Inter', sans-serif;
            font-size: 12px;
            color: #999;
        }

        /* Dark mode support */
        body.dark-mode .tool-card,
        body.dark-mode .hiw-card,
        body.dark-mode .usecase-card,
        body.dark-mode .faq-item,
        body.dark-mode .related-card {
            background: #1e1e2e;
            box-shadow: 0 2px 16px rgba(0,0,0,0.3);
        }
        body.dark-mode .tool-card-header { background: #16162a; border-color: #2a2a3e; }
        body.dark-mode .tool-card-header h2,
        body.dark-mode .section-title,
        body.dark-mode .hiw-card h3,
        body.dark-mode .usecase-card h3,
        body.dark-mode .faq-question h4,
        body.dark-mode .related-info h4 { color: #eee; }
        body.dark-mode .form-group label,
        body.dark-mode .tone-label { color: #aaa; }
        body.dark-mode .form-group input,
        body.dark-mode .form-group select,
        body.dark-mode .form-group textarea {
            background: #16162a; border-color: #2a2a3e; color: #eee;
        }
        body.dark-mode .tone-chip {
            background: #16162a; border-color: #2a2a3e; color: #aaa;
        }
        body.dark-mode .tone-chip.active { background: #2a0a0a; color: #ff8a80; }
        body.dark-mode .story-body { color: #ddd; }
        body.dark-mode .faq-answer p,
        body.dark-mode .section-sub,
        body.dark-mode .hiw-card p,
        body.dark-mode .usecase-card p { color: #aaa; }
        body.dark-mode .faq-question:hover { background: #16162a; }
        body.dark-mode .output-actions { background: #16162a; border-color: #2a2a3e; }
        body.dark-mode .btn-action,
        body.dark-mode .btn-copy {
            background: #1e1e2e; border-color: #2a2a3e; color: #ccc;
        }
        body.dark-mode .tool-stats-bar { border-color: #2a2a3e; }
        body.dark-mode .related-section { background: #12121e; }
        body.dark-mode .tool-section { background: #12121e; }
        body.dark-mode .output-placeholder i { color: #333; }
        body.dark-mode .output-placeholder p { color: #666; }
        body.dark-mode .story-meta-tag { background: #2a2a3e; color: #aaa; }
        body.dark-mode .story-meta-tag.tone-tag { background: #2a0a0a; color: #ff8a80; }
        body.dark-mode .story-meta-tag.words-tag { background: #0a2a0a; color: #81c784; }
