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

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: #f6f8fa;
            color: #1a1a2e;
            min-height: 100vh;
        }

        .header {
            background: linear-gradient(135deg, #ff573b 0%, #ff8a5c 50%, #ffb347 100%);
            padding: 32px 40px;
            position: relative;
            overflow: hidden;
        }

        .header::before {
            content: '';
            position: absolute;
            top: -40px; right: -40px;
            width: 200px; height: 200px;
            background: rgba(255,255,255,0.08);
            border-radius: 50%;
        }

        .header::after {
            content: '';
            position: absolute;
            bottom: -60px; left: 30%;
            width: 250px; height: 250px;
            background: rgba(255,255,255,0.05);
            border-radius: 50%;
        }

        .header-top {
            display: flex; align-items: center; justify-content: space-between;
            position: relative; z-index: 1;
        }

        .header h1 { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 3px; letter-spacing: -0.3px; }

        .header-badge {
            display: inline-block; font-size: 11px; font-weight: 600;
            background: rgba(255,255,255,0.2); backdrop-filter: blur(10px);
            color: #fff; padding: 4px 14px;
            border-radius: 20px; vertical-align: middle; margin-left: 10px;
        }

        .header p { font-size: 13px; color: rgba(255,255,255,0.8); padding-top: 5px; }

        .header-brand {
            font-size: 14px; color: rgba(255,255,255,0.9); white-space: nowrap; font-weight: 500; margin-top: 10px;
        }

        .header-brand a {
            color: #fff; text-decoration: none; font-weight: 800;
            background: rgba(255,255,255,0.2); padding: 4px 12px;
            border-radius: 6px; backdrop-filter: blur(8px);
        }

        .header-brand a:hover { text-decoration: underline; }

        .controls {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 20px 32px;
            background: #fff;
            border-bottom: 1px solid #e3e8ee;
            flex-wrap: wrap;
        }

        .controls label { font-size: 13px; color: #697386; font-weight: 500; }

        .toggle-wrapper {
            display: flex; align-items: center; gap: 10px; white-space: nowrap;
        }
        .toggle-wrapper span {
            font-size: 13px; color: #697386; font-weight: 500;
        }
        .toggle-switch {
            position: relative; width: 44px; height: 24px;
            background: #ddd; border-radius: 12px;
            cursor: pointer; transition: background 0.3s;
            flex-shrink: 0;
        }
        .toggle-switch.active { background: #ff573b; }
        .toggle-switch::after {
            content: '';
            position: absolute; top: 2px; left: 2px;
            width: 20px; height: 20px;
            background: #fff; border-radius: 50%;
            transition: transform 0.3s;
            box-shadow: 0 1px 3px rgba(0,0,0,0.15);
        }
        .toggle-switch.active::after { transform: translateX(20px); }

        .url-count-badge {
            display: inline-block; font-size: 10px; font-weight: 600;
            background: #f0f2f5; color: #697386; padding: 2px 6px;
            border-radius: 4px; margin-left: 8px; vertical-align: middle;
        }

        /* Custom searchable select */
        .custom-select { position: relative; min-width: 320px; }

        .custom-select-trigger {
            background: #fff; color: #1a1a2e; border: 1px solid #d8dee4;
            padding: 10px 16px; border-radius: 8px; font-size: 14px;
            cursor: pointer; display: flex; align-items: center; justify-content: space-between;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        .custom-select-trigger:hover, .custom-select.open .custom-select-trigger { border-color: #ff573b; box-shadow: 0 0 0 3px rgba(99,91,255,0.1); }
        .custom-select-trigger .arrow { font-size: 10px; color: #697386; transition: transform 0.2s; }
        .custom-select.open .arrow { transform: rotate(180deg); }

        .custom-select-dropdown {
            position: absolute; top: calc(100% + 4px); left: 0; right: 0;
            background: #fff; border: 1px solid #e3e8ee; border-radius: 8px;
            z-index: 100; display: none; box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
            max-height: 320px; overflow: hidden; flex-direction: column;
        }

        .custom-select.open .custom-select-dropdown { display: flex; }
        .custom-select-search { padding: 10px 12px; border-bottom: 1px solid #e3e8ee; }

        .custom-select-search input {
            width: 100%; background: #f6f8fa; color: #1a1a2e;
            border: 1px solid #d8dee4; padding: 8px 12px; border-radius: 6px;
            font-size: 13px; outline: none;
        }

        .custom-select-search input:focus { border-color: #ff573b; box-shadow: 0 0 0 3px rgba(99,91,255,0.1); }
        .custom-select-options { overflow-y: auto; max-height: 260px; }

        .custom-select-option {
            padding: 9px 14px; font-size: 13px; cursor: pointer; transition: background 0.1s; white-space: nowrap;
        }

        .custom-select-option:hover { background: #f6f8fa; }
        .custom-select-option.active { background: #ff573b0d; color: #ff573b; }
        .custom-select-option.hidden { display: none; }
        .custom-select-separator { height: 1px; background: #e3e8ee; margin: 4px 14px; }

        /* URL search with autocomplete */
        .url-search-wrapper { position: relative; }

        .url-search-input {
            background: #fff; color: #1a1a2e; border: 1px solid #d8dee4;
            padding: 10px 16px 10px 36px; border-radius: 8px; font-size: 14px;
            min-width: 280px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
        }

        .url-search-input:focus { border-color: #ff573b; box-shadow: 0 0 0 3px rgba(99,91,255,0.1); }

        .url-search-icon {
            position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
            color: #697386; font-size: 14px; pointer-events: none;
        }

        .url-search-clear {
            position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
            background: none; border: none; color: #697386; font-size: 16px;
            cursor: pointer; display: none; padding: 2px 4px;
        }

        .url-search-clear:hover { color: #1a1a2e; }

        .url-autocomplete {
            position: absolute; top: calc(100% + 4px); left: 0; right: 0;
            background: #fff; border: 1px solid #e3e8ee; border-radius: 8px;
            z-index: 100; display: none; box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
            max-height: 300px; overflow-y: auto;
        }

        .url-autocomplete.visible { display: block; }

        .url-ac-item {
            display: flex; align-items: center; gap: 10px;
            padding: 9px 14px; cursor: pointer; transition: background 0.1s;
            border-bottom: 1px solid #f0f2f5;
        }

        .url-ac-item:last-child { border-bottom: none; }
        .url-ac-item:hover { background: #f6f8fa; }
        .url-ac-item img { width: 16px; height: 16px; border-radius: 2px; flex-shrink: 0; }
        .url-ac-domain { font-size: 13px; font-weight: 600; color: #1a1a2e; }

        .url-ac-path {
            font-size: 11px; color: #ff573b; overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap;
        }

        .url-ac-highlight { background: #ff573b1a; color: #ff573b; border-radius: 2px; padding: 0 1px; }

        .url-ac-count {
            font-size: 11px; color: #697386; padding: 8px 14px;
            border-bottom: 1px solid #f0f2f5;
        }

        .stats {
            display: flex; gap: 16px; margin-left: auto; font-size: 13px; color: #697386;
        }

        .stats span {
            background: #f6f8fa; padding: 8px 14px; border-radius: 6px; border: 1px solid #e3e8ee;
        }

        .stats strong { color: #1a1a2e; }

        .btn-export-csv {
            background: #059669; color: #fff; border: none;
            padding: 8px 16px; border-radius: 6px; font-size: 12px;
            font-weight: 600; cursor: pointer; transition: background 0.2s;
        }
        .btn-export-csv:hover { background: #047857; }

        .container { padding: 24px 32px; }

        .table-wrapper {
            background: #fff; border-radius: 12px; border: 1px solid #e3e8ee; overflow-x: auto;
            box-shadow: 0 1px 3px rgba(0,0,0,0.04);
        }

        table { width: 100%; border-collapse: collapse; font-size: 13px; }

        thead th {
            background: #f9fafb; padding: 12px 14px; text-align: left;
            font-weight: 600; color: #697386; font-size: 11px;
            text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
            position: sticky; top: 0; border-bottom: 1px solid #e3e8ee;
        }

        thead th.rank-col { text-align: center; min-width: 36px; padding: 12px 4px; }
        .col-sticky { position: sticky; z-index: 2; background: inherit; }
        thead .col-sticky { z-index: 3; background: #f9fafb; }
        .col-rank { left: 0; }
        .col-url { left: 36px; }
        .col-btn { left: 336px; }
        .col-btn::after { content: ''; position: absolute; top: 0; bottom: 0; right: -6px; width: 6px; background: linear-gradient(to right, rgba(0,0,0,0.04), transparent); }
        tbody td.col-sticky { background: #fff; }
        tbody tr:hover td.col-sticky { background: #f9fafb; }
        thead th.date-header { text-align: center; padding: 12px 2px; font-size: 11px; }
        thead th.sortable { cursor: pointer; transition: background 0.2s, color 0.2s; user-select: none; }
        thead th.sortable:hover { background: #fff3f0; color: #ff573b; }
        thead th.sort-active, thead th.sort-active:hover { background: #ff573b; color: #fff; }
        td.col-active { background: rgba(255, 87, 59, 0.05); }

        tbody tr { border-bottom: 1px solid #f0f2f5; transition: background 0.15s; }
        tbody tr:hover { background: #f9fafb; }
        tbody tr.hidden-row { display: none; }
        tbody td { padding: 10px 0; vertical-align: middle; }

        .rank-num {
            font-weight: 700; font-size: 12px; color: #1a1a2e;
            text-align: center; min-width: 36px; width: 36px;
        }

        .rank-num.top1 { color: #059669; }
        .rank-num.top3 { color: #d97706; }
        .rank-num.top10 { color: #ea580c; }
        .rank-num.top20 { color: #2563eb; }

        .url-cell { max-width: 400px; overflow: hidden; }
        .url-info { display: flex; align-items: center; gap: 8px; position: relative; }
        .favicon { width: 16px; height: 16px; border-radius: 2px; flex-shrink: 0; }

        .url-link {
            text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
            display: block; min-width: 0;
        }

        .url-link:hover .url-domain { text-decoration: underline; }
        .url-external {
            display: none; color: #8792a2;
            padding: 2px; border-radius: 3px;
            position: absolute; right: 0; top: 50%; transform: translateY(-50%);
        }
        .url-external:hover { color: #ff573b; background: #fff0ee; }
        .url-info:hover .url-external { display: inline-flex; }
        .url-domain { font-weight: 600; color: #1a1a2e; font-size: 13px; }
        .url-path { color: #8792a2; font-size: 13px; }

        .url-title {
            color: #8792a2; font-size: 11px; margin-top: 2px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px;
        }

        .avg-header, .avg-cell { width: 50px; min-width: 50px; max-width: 50px; }
        .avg-cell { text-align: center; font-weight: 700; font-size: 12px; }
        .avg-cell.good { color: #059669; }
        .avg-cell.mid { color: #ea580c; }
        .avg-cell.low { color: #dc2626; }

        /* Buttons cell */
        .btn-cell { text-align: right; white-space: nowrap; padding-right: 10px; }

        .btn-mini {
            display: inline-block; padding: 3px 7px; border-radius: 4px;
            font-size: 11px; font-weight: 600; cursor: pointer; border: none;
            transition: opacity 0.15s; margin: 0 1px;
        }

        .btn-mini:hover { opacity: 0.8; }
        .btn-json { background: #05966915; color: #059669; }
        .btn-html { background: #ff573b15; color: #ff573b; }
        .btn-details { background: #3b82f615; color: #3b82f6; }

        .pos-cell { text-align: center; padding: 10px 0; width: 36px; min-width: 36px; max-width: 36px; box-sizing: border-box; cursor: pointer; }

        .pos-badge {
            display: inline-block; width: 26px; height: 22px; line-height: 22px;
            border-radius: 4px; font-size: 12px; font-weight: 600; text-align: center;
            cursor: pointer; transition: transform 0.1s, box-shadow 0.1s;
        }

        .pos-badge:hover { box-shadow: 0 2px 8px rgba(99,91,255,0.2); }

        .pos-badge.p1 { background: #d1fae5; color: #065f46; }
        .pos-badge.p3 { background: #fef3c7; color: #92400e; }
        .pos-badge.p10 { background: #ffedd5; color: #9a3412; }
        .pos-badge.p20 { background: #dbeafe; color: #1e40af; }
        .pos-badge.p50 { background: #ede9fe; color: #5b21b6; }
        .pos-badge.p100 { background: #fee2e2; color: #991b1b; }
        .pos-badge.pout { background: #f3f4f6; color: #c4c7cf; }

        .pos-badge.pother {
            background: #fef3c7; color: #d97706; cursor: pointer;
            font-size: 9px; width: 26px; position: relative;
        }

        .pos-badge.pother:hover { transform: scale(1.3); box-shadow: 0 2px 8px rgba(217,119,6,0.2); }

        .tooltip-other {
            display: none;
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background: #fff;
            border: 1px solid #e3e8ee;
            border-radius: 10px;
            padding: 12px 16px;
            z-index: 200;
            width: 320px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.1);
            pointer-events: none;
        }

        .pos-badge.pother:hover .tooltip-other {
            display: block;
        }

        .tooltip-other::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: #e3e8ee;
        }

        .tooltip-other-label {
            font-size: 11px;
            color: #697386;
            margin-bottom: 6px;
            font-weight: 500;
        }

        .tooltip-other-url {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 4px;
        }

        .tooltip-other-url img {
            width: 14px; height: 14px; border-radius: 2px; flex-shrink: 0;
        }

        .tooltip-other-url a {
            font-size: 11px;
            color: #ff573b;
            text-decoration: none;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .tooltip-other-pos {
            font-size: 13px;
            font-weight: 700;
            color: #d97706;
        }

        .day-separator { border-left: 1px solid #e3e8ee; }

        .loading { text-align: center; padding: 80px 32px; color: #697386; }

        .loading .spinner {
            width: 32px; height: 32px; border: 3px solid #e3e8ee;
            border-top-color: #ff573b; border-radius: 50%;
            animation: spin 0.8s linear infinite; margin: 0 auto 16px;
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        .no-data { text-align: center; padding: 20px 32px; color: #8792a2; font-size: 15px; background: #fff; border-radius: 12px; border: 1px solid #e3e8ee; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
        a.city-best-url { color: #9ca3af; text-decoration: none; }
        a.city-best-url:hover { color: #697386; text-decoration: underline; }

        .pagination {
            display: flex; align-items: center; justify-content: center; gap: 4px;
            padding: 16px 32px; background: #fff; border-top: 1px solid #e3e8ee;
        }
        .pagination button {
            min-width: 32px; height: 32px; border: 1px solid #e3e8ee; background: #fff;
            border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer;
            font-family: inherit; color: #1a1a2e; transition: all 0.15s;
        }
        .pagination button:hover { background: #f6f8fa; border-color: #d0d5dd; }
        .pagination button.active { background: #2563eb; color: #fff; border-color: #2563eb; }
        .pagination button:disabled { opacity: 0.4; cursor: default; }
        .pagination .page-info { font-size: 12px; color: #697386; margin: 0 8px; }
        .pagination .nav-arrow {
            display: flex; align-items: center; justify-content: center;
            width: 32px; height: 32px; border: none; background: none;
            cursor: pointer; color: #697386; transition: color 0.15s; border-radius: 6px;
        }
        .pagination .nav-arrow:hover { color: #2563eb; background: #f6f8fa; }
        .pagination .nav-arrow:disabled { opacity: 0.3; cursor: default; background: none; }
        .pagination .nav-arrow svg { width: 18px; height: 18px; }
        .rows-select { padding: 4px 8px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 12px; color: #697386; background: #fff; cursor: pointer; margin-right: 8px; }

        /* Cities table */
        .cities-section-title {
            font-size: 16px; font-weight: 700; margin: 24px 0 12px;
            display: flex; align-items: center; gap: 8px;
        }
        .cities-section-title .favicon { width: 20px; height: 20px; border-radius: 4px; }
        .current-city-label { color: #ff573b; font-weight: 700; }
        .cities-group-sep td { height: 2px; padding: 0; background: #ff573b; border: none; opacity: 0.3; }
        .cities-loading { text-align: center; padding: 40px; color: #697386; font-size: 14px; }
        .cities-loading svg.cities-loader { display: block; margin: 0 auto 16px; }
        @keyframes radar-sweep { to { transform: rotate(360deg); } }
        @keyframes radar-ping { 0% { r: 4; opacity: 0.7; } 100% { r: 22; opacity: 0; } }
        @keyframes dot-blink-1 { 0%,40% { opacity: 0; } 50%,100% { opacity: 1; } }
        @keyframes dot-blink-2 { 0%,55% { opacity: 0; } 65%,100% { opacity: 1; } }
        @keyframes dot-blink-3 { 0%,70% { opacity: 0; } 80%,100% { opacity: 1; } }

        /* Modal */
        .modal-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.3);
            backdrop-filter: blur(4px); z-index: 1000;
            display: flex; align-items: center; justify-content: center;
            opacity: 0; transition: opacity 0.2s;
        }

        .modal-overlay.visible { opacity: 1; }

        .modal {
            background: #fff; border: 1px solid #e3e8ee; border-radius: 16px;
            width: 780px; max-height: 90vh; display: flex; flex-direction: column;
            transform: scale(0.95); transition: transform 0.2s;
            box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
        }

        .modal-overlay.visible .modal { transform: scale(1); }

        .modal-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 20px 24px; border-bottom: 1px solid #e3e8ee;
        }

        .modal-header h2 { font-size: 16px; font-weight: 600; color: #1a1a2e; }
        .modal-header .subtitle { font-size: 12px; color: #697386; margin-top: 2px; }

        .modal-nav {
            display: flex; align-items: center; gap: 8px;
        }

        .modal-nav-btn {
            width: 36px; height: 36px; border: 1px solid #d8dee4; background: #fff;
            color: #697386; border-radius: 8px; font-size: 18px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
        }

        .modal-nav-btn:hover:not(:disabled) { background: #f6f8fa; color: #1a1a2e; border-color: #ff573b; }
        .modal-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

        .modal-close {
            width: 36px; height: 36px; border: none; background: #f6f8fa;
            color: #697386; border-radius: 8px; font-size: 18px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: background 0.15s, color 0.15s;
        }

        .modal-close:hover { background: #e3e8ee; color: #1a1a2e; }

        .modal-tabs {
            display: flex; border-bottom: 1px solid #e3e8ee;
        }

        .modal-tab {
            padding: 10px 20px; font-size: 13px; font-weight: 600;
            cursor: pointer; color: #697386; border-bottom: 2px solid transparent;
            transition: color 0.15s, border-color 0.15s;
        }

        .modal-tab:hover { color: #1a1a2e; }
        .modal-tab.active { color: #ff573b; border-bottom-color: #ff573b; }

        .modal-body { overflow-y: auto; padding: 0; flex: 1; }

        .serp-list { list-style: none; }

        .serp-item {
            display: flex; align-items: center; gap: 14px;
            padding: 12px 24px; border-bottom: 1px solid #f0f2f5;
            transition: background 0.15s;
        }

        .serp-item:hover { background: #f9fafb; }
        .serp-item.serp-highlight { background: rgba(255, 87, 59, 0.12); border-left: 3px solid #ff573b; }
        .serp-item.serp-highlight:hover { background: rgba(255, 87, 59, 0.16); }

        .serp-rank {
            font-weight: 700; font-size: 14px; min-width: 28px;
            text-align: center; flex-shrink: 0;
        }

        .serp-rank.r1 { color: #059669; }
        .serp-rank.r3 { color: #d97706; }
        .serp-rank.r10 { color: #ea580c; }
        .serp-rank.r20 { color: #2563eb; }
        .serp-rank.r50 { color: #7c3aed; }
        .serp-rank.r100 { color: #dc2626; }

        .serp-favicon { width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0; }
        .serp-info { flex: 1; min-width: 0; }

        .serp-title {
            font-size: 13px; color: #1a1a2e; font-weight: 500;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }

        .serp-url {
            font-size: 11px; color: #ff573b; text-decoration: none;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
            display: block; margin-top: 2px;
        }

        .serp-url:hover { text-decoration: underline; }

        .html-container { padding: 0; background: #fff; }

        .html-container { padding: 0; background: #fff; }
        .html-container iframe {
            width: 100%; border: 0; height: 5000px; scrollbar-width: none;
        }
        .html-container iframe::-webkit-scrollbar { display: none; }

        .html-pages-tabs {
            display: flex; background: #f9fafb; border-bottom: 1px solid #e3e8ee;
        }

        .html-page-tab {
            padding: 8px 16px; font-size: 12px; font-weight: 600;
            cursor: pointer; color: #697386; border-bottom: 2px solid transparent;
            transition: color 0.15s;
        }

        .html-page-tab:hover { color: #1a1a2e; }
        .html-page-tab.active { color: #ff573b; border-bottom-color: #ff573b; }

        /* Day picker */
        .geo-warning {
            background: #fff8ed; border: 1px solid #f59e0b; border-left: 4px solid #f59e0b;
            color: #92400e; padding: 12px 16px; border-radius: 8px;
            font-size: 13px; line-height: 1.5; margin-bottom: 16px;
        }

        .day-picker {
            display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
        }

        .day-chip {
            padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
            border: 1px solid #e3e8ee; background: #fff; color: #697386;
            cursor: pointer; transition: all 0.15s; white-space: nowrap;
        }

        .day-chip:hover { border-color: #ff573b; color: #ff573b; }
        .day-chip.active { background: #ff573b; color: #fff; border-color: #ff573b; }
        .day-chip.empty { opacity: 0.4; }

        /* Sparkline */
        .chart-col-header { text-align: center; width: 100px; padding: 12px 4px; font-size: 11px; }
        .chart-cell { padding: 6px 4px; text-align: center; width: 100px; cursor: pointer; }
        .chart-cell:hover { background: #f9fafb; }

        .chart-legend {
            display: flex; flex-wrap: wrap; gap: 12px 20px;
            margin-top: 16px; padding-top: 12px;
            border-top: 1px solid #e3e8ee;
        }
        .chart-legend-item {
            display: flex; align-items: center; gap: 6px;
            font-size: 12px; color: #1a1a2e;
        }
        .chart-legend-dot {
            width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
        }
        .chart-legend-url {
            max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .chart-tooltip {
            position: fixed; z-index: 1100; pointer-events: none;
            background: #fff; border: 1px solid #e3e8ee; border-radius: 8px;
            padding: 8px 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            font-size: 12px; color: #1a1a2e; white-space: nowrap;
        }
        .chart-tip-row {
            display: flex; align-items: center; gap: 6px; margin-top: 8px;
        }
        .chart-tip-pos {
            font-weight: 800; font-size: 14px; min-width: 24px; text-align: right;
        }
        .sparkline-svg { display: block; margin: 0 auto; }

        .spark-tooltip {
            position: fixed; z-index: 300; pointer-events: none;
            background: #fff; border: 1px solid #e3e8ee; border-radius: 8px;
            padding: 6px 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            font-size: 11px; color: #1a1a2e; white-space: nowrap;
            display: none;
        }

        .spark-tooltip strong { color: #ff573b; }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 768px) {
            .header { padding: 20px 16px; }
            .header h1 { font-size: 18px; }
            .header-top { flex-direction: column; align-items: flex-start; gap: 8px; }
            .header-brand { margin-top: 4px; }

            .controls {
                padding: 12px 16px; gap: 10px;
                flex-direction: column; align-items: stretch;
            }
            .controls label { display: none; }
            .custom-select { min-width: 100%; }
            .url-search-wrapper { width: 100%; }
            .toggle-wrapper { justify-content: flex-start; }
            .stats { margin-left: 0; flex-wrap: wrap; gap: 8px; }
            .stats span { font-size: 11px; padding: 6px 10px; }
            .btn-export-csv { font-size: 11px; padding: 6px 12px; }

            .container { padding: 12px; }
            .geo-warning { font-size: 12px; padding: 10px 12px; }
            .day-picker { gap: 4px; }
            .day-chip { font-size: 11px; padding: 6px 10px; }

            /* ===== Mobile table ===== */
            .table-wrapper { border-radius: 8px; }
            table { font-size: 12px; }
            thead th { padding: 8px 6px; font-size: 10px; }
            tbody td { padding: 6px 0; }

            /* Hide sparkline + buttons */
            .chart-cell, .chart-col-header, .day-separator { display: none !important; }
            .col-btn { display: none !important; }

            /* URL sticky at 40vw */
            .url-cell { max-width: 40vw; width: 40vw; }
            .url-domain { font-size: 12px; }
            .url-path { display: none; }
            .favicon { width: 14px; height: 14px; }

            .rank-num { font-size: 11px; }
            .avg-cell { font-size: 11px; }
            .pos-cell { width: 32px; min-width: 32px; }
            .pos-badge { font-size: 10px; min-width: 22px; padding: 2px 4px; }

            /* Modal */
            .modal { width: 95vw !important; max-height: 85vh; border-radius: 12px; }
            .modal-header { padding: 14px 16px; }
            .modal-header h2 { font-size: 14px; }
            .modal-body { padding: 0; }
            .serp-item { padding: 8px 12px; gap: 10px; }
            .serp-rank { font-size: 12px; min-width: 24px; }
            .serp-title { font-size: 12px; }
            .serp-url { font-size: 10px; }

            .chart-legend { gap: 8px 12px; }
            .chart-legend-item { font-size: 11px; }
            .chart-legend-url { max-width: 150px; }
        }

        @media (max-width: 480px) {
            .header h1 { font-size: 16px; }
            .header-badge { font-size: 10px; padding: 3px 8px; }
            .header p { font-size: 11px; }
            .header-brand { font-size: 12px; }

            .url-domain { font-size: 11px; }
            .url-count-badge { display: none; }

            .rank-num { font-size: 13px; }
            .pos-badge { font-size: 10px; width: 24px; height: 22px; line-height: 22px; }

            .day-chip { font-size: 10px; padding: 5px 8px; }
            .stats { font-size: 11px; }
        }

        .legal-footer { text-align: center; padding: 20px; font-size: 12px; }
        .legal-footer a { color: #697386; text-decoration: none; }
        .legal-footer a:hover { text-decoration: underline; }
        .legal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 9999; align-items: center; justify-content: center; }
        .legal-box { background: #fff; border-radius: 12px; padding: 32px; max-width: 560px; width: 90vw; max-height: 80vh; overflow-y: auto; position: relative; }
        .legal-box h2 { margin-bottom: 16px; font-size: 18px; color: #1a1a2e; }
        .legal-box p { margin-bottom: 12px; font-size: 13px; color: #4a5568; line-height: 1.6; }
        .legal-close { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 24px; cursor: pointer; color: #697386; }
