/**
 * HANEL.PRO - Google Ads Keyword Grouper & Clusterer
 * Stylesheet: style.css
 */
        :root {
            --bg-page: #03101c;
            --bg-surface: #071526;
            --bg-card: #0b1a2d;
            --bg-card-hover: #0f233d;
            --brand: #00a3e2;
            --brand-light: #38bdf8;
            --brand-glow: rgba(0, 163, 226, 0.25);
            --border: rgba(255, 255, 255, 0.08);
            --border-focus: rgba(0, 163, 226, 0.5);
            --text-heading: #ffffff;
            --text-body: #94a3b8;
            --text-muted: #64748b;
            --emerald: #10b981;
            --emerald-light: #34d399;
            --amber: #f59e0b;
            --amber-light: #fbbf24;
            --purple: #a855f7;
            --purple-light: #c084fc;
            --cyan: #06b6d4;
            --cyan-light: #22d3ee;
            --danger: #ef4444;
            --danger-light: #f87171;
        }

        * { box-sizing: border-box; }

        body {
            background-color: var(--bg-page);
            color: var(--text-body);
            font-family: 'Inter', sans-serif;
            margin: 0;
            padding: 0;
            line-height: 1.6;
            min-height: 100vh;
        }

        /* Top Bar & Nav */
        .tool-nav {
            background: rgba(3, 16, 28, 0.85);
            backdrop-filter: blur(16px);
            border-bottom: 1px solid var(--border);
            padding: 14px 24px;
            position: sticky;
            top: 0;
            z-index: 50;
        }
        .tool-nav-inner {
            max-width: 1440px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .back-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--brand);
            font-size: 0.85rem;
            font-weight: 600;
            text-decoration: none;
            transition: 0.2s;
        }
        .back-link:hover {
            color: var(--brand-light);
            transform: translateX(-3px);
        }

        /* Layout Container */
        .tool-container {
            max-width: 1440px;
            margin: 28px auto 60px;
            padding: 0 24px;
            transition: max-width 0.3s ease;
        }
        .tool-container.full-width {
            max-width: 98% !important;
        }

        /* Header Card */
        .tool-header-card {
            background: linear-gradient(135deg, rgba(11, 26, 45, 0.95) 0%, rgba(7, 21, 38, 0.85) 100%);
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 26px 30px;
            margin-bottom: 24px;
            position: relative;
            overflow: hidden;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
        }
        .tool-header-card::after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 320px;
            height: 100%;
            background: radial-gradient(circle at right top, rgba(0, 163, 226, 0.15), transparent 70%);
            pointer-events: none;
        }
        .badge-category {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 12px;
            border-radius: 999px;
            background: rgba(0, 163, 226, 0.12);
            border: 1px solid rgba(0, 163, 226, 0.25);
            color: var(--brand-light);
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 10px;
        }
        .badge-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--brand);
            box-shadow: 0 0 8px var(--brand);
        }
        .tool-header-card h1 {
            color: var(--text-heading);
            font-size: 1.75rem;
            font-weight: 800;
            margin: 0 0 8px;
            letter-spacing: -0.02em;
        }
        .tool-header-card p {
            color: #94a3b8;
            font-size: 0.92rem;
            margin: 0;
            max-width: 950px;
            line-height: 1.6;
        }

        /* Stats Bar */
        .cluster-stats-bar {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 22px;
        }
        .stat-card {
            background: #071526;
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 14px 18px;
            display: flex;
            flex-direction: column;
            gap: 4px;
            position: relative;
            overflow: hidden;
            transition: 0.2s;
        }
        .stat-card:hover {
            border-color: rgba(255, 255, 255, 0.15);
            transform: translateY(-2px);
        }
        .stat-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: var(--stat-color, var(--brand));
        }
        .stat-label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .stat-value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 1.55rem;
            font-weight: 800;
            color: #ffffff;
            display: flex;
            align-items: baseline;
            gap: 6px;
        }
        .stat-value small {
            font-size: 0.78rem;
            font-weight: 600;
            color: var(--text-muted);
        }

        /* Workspace Grid: Left Input & Rules, Right Grouped Output */
        .workspace-grid {
            display: grid;
            grid-template-columns: 440px 1fr;
            gap: 24px;
            margin-bottom: 30px;
            align-items: start;
        }

        @media (max-width: 1100px) {
            .workspace-grid {
                grid-template-columns: 1fr;
            }
        }

        /* Card panels */
        .panel-card {
            background: #071526;
            border: 1px solid var(--border);
            border-radius: 18px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            display: flex;
            flex-direction: column;
        }

        .panel-header {
            padding: 16px 20px;
            background: rgba(5, 16, 29, 0.7);
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .panel-title {
            color: #ffffff;
            font-size: 0.95rem;
            font-weight: 700;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .panel-body {
            padding: 18px 20px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        /* Textarea input */
        .raw-textarea {
            width: 100%;
            height: 250px;
            background: #040e1a;
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 12px 14px;
            color: #ffffff;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.82rem;
            line-height: 1.6;
            resize: vertical;
            outline: none;
            transition: border-color 0.2s;
        }
        .raw-textarea:focus {
            border-color: var(--brand);
            box-shadow: 0 0 0 3px var(--brand-glow);
        }

        /* Action Buttons & Chips */
        .btn-action {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 9px 15px;
            border-radius: 10px;
            font-size: 0.82rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.05);
            color: #cbd5e1;
            text-decoration: none;
        }
        .btn-action:hover {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.2);
        }
        .btn-primary {
            background: var(--brand);
            border-color: var(--brand);
            color: #ffffff;
            box-shadow: 0 4px 15px rgba(0, 163, 226, 0.3);
        }
        .btn-primary:hover {
            background: #0284c7;
            border-color: #0284c7;
            box-shadow: 0 4px 20px rgba(0, 163, 226, 0.5);
            color: #ffffff;
        }
        .btn-emerald {
            background: rgba(16, 185, 129, 0.15);
            border-color: rgba(16, 185, 129, 0.4);
            color: #34d399;
        }
        .btn-emerald:hover {
            background: var(--emerald);
            color: #ffffff;
            box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
        }
        .chip-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border);
            color: #cbd5e1;
            padding: 5px 10px;
            border-radius: 7px;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }
        .chip-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
        }

        /* Rules Accordion / Builder */
        .rules-section {
            background: #05101d;
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 14px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .rules-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .rules-title {
            color: #ffffff;
            font-size: 0.85rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .rule-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 280px;
            overflow-y: auto;
            padding-right: 4px;
        }
        .rule-item-row {
            background: #081729;
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: 8px;
            padding: 8px 10px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.78rem;
        }
        .rule-input-camp {
            width: 210px;
            background: #040e1a;
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 4px 8px;
            color: #38bdf8;
            font-size: 0.75rem;
            font-weight: 600;
            outline: none;
        }
        .rule-input-adgroup {
            width: 160px;
            background: #040e1a;
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 4px 8px;
            color: #34d399;
            font-size: 0.75rem;
            font-weight: 600;
            outline: none;
        }
        .rule-input-tokens {
            flex: 1;
            background: #040e1a;
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 4px 8px;
            color: #ffffff;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            outline: none;
        }
        .btn-rule-del {
            background: transparent;
            border: none;
            color: var(--danger-light);
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.8rem;
        }
        .btn-rule-del:hover {
            background: rgba(239, 68, 68, 0.2);
        }

        /* Preset buttons group */
        .preset-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .preset-btn {
            background: rgba(0, 163, 226, 0.1);
            border: 1px solid rgba(0, 163, 226, 0.25);
            color: var(--brand-light);
            padding: 5px 10px;
            border-radius: 7px;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            transition: 0.2s;
        }
        .preset-btn:hover {
            background: var(--brand);
            color: #ffffff;
        }

        /* STAG & Clustering Strategy Selector Bar */
        .mode-selector-card {
            background: linear-gradient(135deg, rgba(7, 21, 38, 0.95) 0%, rgba(11, 26, 45, 0.9) 100%);
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 12px 18px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
        }
        .mode-selector-left {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }
        .mode-title-label {
            font-size: 0.78rem;
            font-weight: 800;
            color: #ffffff;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .mode-tabs-pill {
            display: inline-flex;
            background: #040e1a;
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 3px;
            gap: 3px;
        }
        .mode-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            padding: 7px 15px;
            border-radius: 8px;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            transition: all 0.2s;
        }
        .mode-btn:hover:not(.active) {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.05);
        }
        .mode-btn.active.cluster {
            background: rgba(0, 163, 226, 0.2);
            border: 1px solid rgba(0, 163, 226, 0.5);
            color: var(--brand-light);
            box-shadow: 0 2px 10px rgba(0, 163, 226, 0.25);
        }
        .mode-btn.active.stag {
            background: rgba(16, 185, 129, 0.2);
            border: 1px solid rgba(16, 185, 129, 0.5);
            color: #34d399;
            box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
        }
        .mode-btn.active.skag {
            background: rgba(245, 158, 11, 0.2);
            border: 1px solid rgba(245, 158, 11, 0.5);
            color: var(--amber-light);
            box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
        }
        .mode-btn.active.skc {
            background: rgba(168, 85, 247, 0.22);
            border: 1px solid rgba(168, 85, 247, 0.55);
            color: #c084fc;
            box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
        }
        .mode-btn.active.sac {
            background: rgba(14, 165, 233, 0.22);
            border: 1px solid rgba(14, 165, 233, 0.55);
            color: #38bdf8;
            box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
        }
        .affiliate-alert-banner {
            background: linear-gradient(135deg, rgba(30, 16, 40, 0.95) 0%, rgba(15, 10, 25, 0.95) 100%);
            border: 1px solid rgba(245, 158, 11, 0.35);
            border-left: 4px solid #f59e0b;
            border-radius: 12px;
            padding: 14px 18px;
            margin-bottom: 20px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        }
        .badge-skc {
            background: #9333ea;
            color: #ffffff;
            padding: 2px 7px;
            border-radius: 4px;
            font-size: 0.72rem;
            font-weight: 700;
        }
        .badge-sac {
            background: #0284c7;
            color: #ffffff;
            padding: 2px 7px;
            border-radius: 4px;
            font-size: 0.72rem;
            font-weight: 700;
        }
        .stag-config-controls {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            padding-left: 12px;
            border-left: 1px solid rgba(255, 255, 255, 0.1);
            transition: opacity 0.2s, filter 0.2s;
        }
        .stag-select {
            background: #040e1a;
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 5px 9px;
            color: #ffffff;
            font-size: 0.76rem;
            font-family: 'JetBrains Mono', monospace;
            outline: none;
            transition: border-color 0.2s;
        }
        .stag-select:focus {
            border-color: var(--brand);
        }
        .stag-badge-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 6px;
            background: rgba(0, 163, 226, 0.12);
            border: 1px solid rgba(0, 163, 226, 0.3);
            color: var(--brand-light);
            font-size: 0.74rem;
            font-weight: 700;
        }

        /* Strategy Guide Cheatsheet (Collapsible) */
        .guide-collapse-card {
            background: #05101d;
            border: 1px solid var(--border);
            border-radius: 12px;
            margin-bottom: 20px;
            overflow: hidden;
            transition: all 0.3s ease;
        }
        .guide-header {
            padding: 12px 18px;
            background: rgba(255, 255, 255, 0.02);
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            user-select: none;
        }
        .guide-header:hover {
            background: rgba(255, 255, 255, 0.04);
        }
        .guide-body {
            padding: 16px 18px;
            border-top: 1px solid var(--border);
            background: #040e1a;
        }
        .guide-comparison-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.8rem;
        }
        .guide-comparison-table th {
            background: #081729;
            padding: 10px 14px;
            color: #cbd5e1;
            font-weight: 700;
            text-align: left;
            border: 1px solid rgba(255, 255, 255, 0.07);
        }
        .guide-comparison-table td {
            padding: 10px 14px;
            border: 1px solid rgba(255, 255, 255, 0.05);
            color: #94a3b8;
            line-height: 1.5;
        }
        .guide-comparison-table tr:hover td {
            background: rgba(255, 255, 255, 0.02);
        }
        .badge-skag {
            background: rgba(245, 158, 11, 0.15);
            color: #fbbf24;
            padding: 2px 7px;
            border-radius: 4px;
            font-weight: 600;
            font-size: 0.72rem;
            display: inline-block;
        }
        .badge-stag {
            background: rgba(16, 185, 129, 0.15);
            color: #34d399;
            padding: 2px 7px;
            border-radius: 4px;
            font-weight: 600;
            font-size: 0.72rem;
            display: inline-block;
        }
        .badge-cluster {
            background: rgba(0, 163, 226, 0.15);
            color: #38bdf8;
            padding: 2px 7px;
            border-radius: 4px;
            font-weight: 600;
            font-size: 0.72rem;
            display: inline-block;
        }

        /* Modal Overlay for Cross-Negatives */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(6px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 20px;
        }
        .modal-box {
            background: #071526;
            border: 1px solid var(--border);
            border-radius: 16px;
            max-width: 850px;
            width: 100%;
            max-height: 85vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
            overflow: hidden;
        }
        .modal-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #05101d;
        }
        .modal-body {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        /* View Tabs & Control bar */
        .view-tabs-group {
            display: flex;
            background: #05101d;
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 3px;
            gap: 3px;
        }
        .view-tab-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            padding: 6px 14px;
            border-radius: 7px;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .view-tab-btn.active {
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }
        .view-tab-btn:hover:not(.active) {
            color: #cbd5e1;
        }

        /* Match type selector */
        .match-type-pill {
            display: inline-flex;
            background: #05101d;
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 2px;
            gap: 2px;
        }
        .match-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 0.74rem;
            font-weight: 700;
            cursor: pointer;
            font-family: 'JetBrains Mono', monospace;
            transition: 0.2s;
        }
        .match-btn.active {
            background: rgba(16, 185, 129, 0.2);
            color: #34d399;
        }

        /* Output View 1: Flat Table (Google Ads Editor Style) */
        .table-responsive-wrap {
            overflow-x: auto;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: #040e1a;
            max-height: 600px;
            overflow-y: auto;
        }
        .ads-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.82rem;
            text-align: left;
        }
        .ads-table th {
            background: #081729;
            color: #cbd5e1;
            font-weight: 700;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 10;
            white-space: nowrap;
        }
        .ads-table td {
            padding: 10px 16px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            color: #e2e8f0;
            vertical-align: middle;
        }
        .ads-table tr:hover td {
            background: rgba(255, 255, 255, 0.03);
        }
        .col-camp-badge {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 6px;
            background: rgba(0, 163, 226, 0.15);
            color: #38bdf8;
            border: 1px solid rgba(0, 163, 226, 0.3);
            font-weight: 600;
            font-size: 0.75rem;
            font-family: 'JetBrains Mono', monospace;
        }
        .col-adgroup-badge {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 6px;
            font-weight: 600;
            font-size: 0.75rem;
            font-family: 'JetBrains Mono', monospace;
            background: rgba(0, 163, 226, 0.15);
            color: #38bdf8;
            border: 1px solid rgba(0, 163, 226, 0.3);
        }
        .col-adgroup-badge.cluster-adgroup {
            background: rgba(0, 163, 226, 0.15);
            color: #38bdf8;
            border-color: rgba(0, 163, 226, 0.35);
        }
        .col-adgroup-badge.stag-adgroup {
            background: rgba(16, 185, 129, 0.15);
            color: #34d399;
            border-color: rgba(16, 185, 129, 0.35);
        }
        .col-adgroup-badge.skag-adgroup {
            background: rgba(245, 158, 11, 0.15);
            color: #fbbf24;
            border-color: rgba(245, 158, 11, 0.35);
        }
        .col-adgroup-badge.skc-adgroup {
            background: rgba(168, 85, 247, 0.15);
            color: #c084fc;
            border-color: rgba(168, 85, 247, 0.35);
        }
        .col-adgroup-badge.sac-adgroup {
            background: rgba(14, 165, 233, 0.15);
            color: #38bdf8;
            border-color: rgba(14, 165, 233, 0.35);
        }
        .col-kw-text {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 500;
            color: #ffffff;
        }
        .col-match-badge {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.7rem;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            background: rgba(255, 255, 255, 0.06);
            color: var(--text-muted);
        }

        /* Output View 2: Grouped Cards View */
        .cards-view-wrap {
            display: flex;
            flex-direction: column;
            gap: 16px;
            max-height: 650px;
            overflow-y: auto;
            padding-right: 4px;
        }
        .campaign-group-card {
            background: #05101d;
            border: 1px solid var(--border);
            border-radius: 14px;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }
        .camp-header {
            padding: 12px 18px;
            background: linear-gradient(90deg, rgba(0, 163, 226, 0.2) 0%, rgba(5, 16, 29, 0.8) 100%);
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .camp-title {
            color: #ffffff;
            font-size: 0.92rem;
            font-weight: 800;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .adgroup-grid {
            padding: 14px 18px;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 14px;
        }
        .adgroup-item-card {
            background: #081729;
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 10px;
            padding: 12px 14px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .adgroup-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
            padding-bottom: 8px;
        }
        .adgroup-item-title {
            color: #34d399;
            font-weight: 700;
            font-size: 0.82rem;
            font-family: 'JetBrains Mono', monospace;
            margin: 0;
        }
        .adgroup-kw-list {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
            max-height: 160px;
            overflow-y: auto;
        }
        .adgroup-kw-item {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.78rem;
            color: #cbd5e1;
            padding: 3px 6px;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.02);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .adgroup-kw-item:hover {
            background: rgba(255, 255, 255, 0.06);
            color: #ffffff;
        }

        /* Output View 3: Plain Hierarchical Text */
        .plain-text-preview {
            width: 100%;
            height: 550px;
            background: #040e1a;
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 16px;
            color: #34d399;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.83rem;
            line-height: 1.7;
            outline: none;
            resize: vertical;
        }

        /* Empty state */
        .empty-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 350px;
            color: var(--text-muted);
            text-align: center;
            padding: 30px;
            gap: 10px;
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            background: #071526;
            border: 1px solid var(--brand);
            color: #ffffff;
            padding: 12px 20px;
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
            transform: translateY(100px);
            opacity: 0;
            transition: all 0.3s;
            z-index: 100;
        }
        .toast.show {
            transform: translateY(0);
            opacity: 1;
        }

        /* Intent Badges */
        .badge-intent {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 7px;
            border-radius: 4px;
            font-size: 0.68rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }
        .badge-intent-trans {
            background: rgba(16, 185, 129, 0.15);
            color: #34d399;
            border: 1px solid rgba(16, 185, 129, 0.35);
        }
        .badge-intent-comm {
            background: rgba(56, 189, 248, 0.15);
            color: #38bdf8;
            border: 1px solid rgba(56, 189, 248, 0.35);
        }
        .badge-intent-info {
            background: rgba(239, 68, 68, 0.15);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.35);
        }
        .badge-intent-gen {
            background: rgba(255, 255, 255, 0.08);
            color: #cbd5e1;
            border: 1px solid rgba(255, 255, 255, 0.15);
        }

        /* RSA Preview Component */
        .rsa-box-container {
            margin-top: 10px;
            background: rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(0, 163, 226, 0.2);
            border-radius: 8px;
            padding: 10px 12px;
        }
        .rsa-box-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
        }
        .rsa-box-title {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--brand-light);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .rsa-headlines-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .rsa-headline-item {
            font-size: 0.74rem;
            color: #ffffff;
            font-family: 'JetBrains Mono', monospace;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 4px;
            padding: 3px 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .rsa-headline-item:hover {
            border-color: rgba(56, 189, 248, 0.4);
            background: rgba(56, 189, 248, 0.05);
        }

        /* Affiliate Strategy & Guide Box */
        .strategy-step-card {
            background: #081729;
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 14px 16px;
            margin-bottom: 12px;
        }
        .strategy-step-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }
        .strategy-step-number {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: rgba(0, 163, 226, 0.2);
            color: var(--brand-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 0.78rem;
        }
        .strategy-step-title {
            color: #ffffff;
            font-size: 0.88rem;
            font-weight: 700;
            margin: 0;
        }
        .strategy-step-desc {
            font-size: 0.78rem;
            color: #94a3b8;
            line-height: 1.6;
            margin: 0;
        }

        /* Negative Match Choice Cards in Prompt Modal */
        .negative-match-choice {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 13px 16px;
            background: #040e1a;
            border: 1px solid var(--border);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .negative-match-choice:hover {
            background: #081729;
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
        }
        .negative-match-choice.choice-exact:hover {
            border-color: rgba(244, 63, 94, 0.55);
        }
        .negative-match-choice.choice-phrase:hover {
            border-color: rgba(56, 189, 248, 0.55);
        }
        .negative-match-choice.choice-broad:hover {
            border-color: rgba(245, 158, 11, 0.55);
        }
        .negative-match-choice .choice-icon {
            font-size: 1.5rem;
            line-height: 1;
            flex-shrink: 0;
        }
        .negative-match-choice .choice-title {
            font-size: 0.88rem;
        }
        .negative-match-choice .choice-desc {
            font-size: 0.77rem;
            color: #cbd5e1;
            margin: 2px 0 4px;
        }
        .negative-match-choice .choice-desc code {
            background: rgba(255, 255, 255, 0.08);
            padding: 1px 6px;
            border-radius: 4px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.74rem;
        }
        .negative-match-choice .choice-note {
            font-size: 0.72rem;
            color: var(--text-muted);
            line-height: 1.4;
        }
        .badge-recommend {
            background: rgba(16, 185, 129, 0.2);
            border: 1px solid rgba(16, 185, 129, 0.45);
            color: #34d399;
            font-size: 0.68rem;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 4px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }
        .btn-sm {
            padding: 6px 12px;
            font-size: 0.76rem;
            border-radius: 8px;
        }
        .btn-cyan {
            background: rgba(6, 182, 212, 0.15);
            border-color: rgba(6, 182, 212, 0.4);
            color: #22d3ee;
        }
        .btn-cyan:hover {
            background: var(--cyan);
            color: #ffffff;
            box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
        }
        .btn-amber {
            background: rgba(245, 158, 11, 0.15);
            border-color: rgba(245, 158, 11, 0.4);
            color: #fbbf24;
        }
        .btn-amber:hover {
            background: var(--amber);
            color: #ffffff;
            box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
        }

        .eu-country-badge {
            background: rgba(239, 68, 68, 0.08);
            border: 1px solid rgba(239, 68, 68, 0.25);
            color: #fca5a5;
            padding: 4px 6px;
            border-radius: 6px;
            font-size: 0.72rem;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            transition: all 0.2s;
        }
        .eu-country-badge:hover {
            background: rgba(239, 68, 68, 0.18);
            border-color: rgba(239, 68, 68, 0.5);
            color: #ffffff;
        }



