/* Homepage rankings table, filters and pagination. */
:root {
            --color-bg: #f6f7f9;
            --color-surface: #FFFFFF;
            --color-border: #e3e5e9;
            --color-border-hover: #D1D5DB;
            --color-text-primary: #0f1115;
            --color-text-secondary: #555d6b;
            --color-text-muted: #6B7280;
            --color-primary: #2e4be0;
            --color-primary-hover: #2338c4;
            --color-green: #13894f;
            --color-red: #DC2626;
        }

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

        body {
            background-color: var(--color-bg);
            color: var(--color-text-primary);
            font-family: 'Urbanist', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            -webkit-font-smoothing: antialiased;
            min-height: 100vh;
            padding: 0;
            margin: 0;
        }

        .main-wrapper {
            max-width: 1170px;
            margin: 36px auto 70px;
            padding: 0 16px;
        }

        /* STICKY ACTION & FILTER BAR (Clean, non-bubbly, crisp rectangular with subtle radius) */
        .filter-sticky-bar {
            position: sticky;
            top: 14px;
            z-index: 1000;
            display: flex;
            justify-content: flex-end;
            margin-bottom: 24px;
            pointer-events: none;
        }
        .filter-controls-card {
            pointer-events: auto;
            background: #FFFFFF;
            border: 1px solid var(--color-border);
            border-radius: 8px;
            padding: 6px 8px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        /* Mode Switcher */
        .mode-switcher {
            display: inline-flex;
            background: #f6f7f9;
            padding: 2px;
            border-radius: 6px;
            gap: 2px;
        }
        .mode-btn {
            background: none;
            border: none;
            font-size: 13px;
            font-weight: 500;
            color: #555d6b;
            padding: 5px 12px;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .mode-btn.active {
            background: #FFFFFF;
            color: #0f1115;
            font-weight: 600;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }
        .mode-btn:hover:not(.active) {
            color: #0f1115;
        }

        /* Dropdown Trigger Buttons */
        .dropdown-wrapper {
            position: relative;
        }
        .dropdown-trigger-btn {
            background: #f6f7f9;
            border: 1px solid var(--color-border);
            border-radius: 6px;
            padding: 6px 12px;
            font-size: 13px;
            font-weight: 500;
            color: #1F2937;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .dropdown-trigger-btn:hover, .dropdown-trigger-btn.open {
            background: #FFFFFF;
            border-color: var(--color-border-hover);
        }
        .trigger-flag {
            font-size: 13px;
            line-height: 1;
        }
        .trigger-text {
            max-width: 140px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .chevron-icon {
            transition: transform 0.2s;
            color: #6B7280;
        }
        .dropdown-trigger-btn.open .chevron-icon {
            transform: rotate(180deg);
        }

        /* Dropdown Menus */
        .dropdown-menu-panel {
            position: absolute;
            top: calc(100% + 6px);
            right: 0;
            width: 280px;
            background: #FFFFFF;
            border: 1px solid var(--color-border);
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
            padding: 8px;
            display: none;
            flex-direction: column;
            z-index: 1050;
        }
        .dropdown-menu-panel.show {
            display: flex;
        }
        .search-input-box {
            display: flex;
            align-items: center;
            gap: 8px;
            border: 1px solid var(--color-border);
            border-radius: 6px;
            padding: 7px 10px;
            background: #f6f7f9;
            margin-bottom: 6px;
            transition: border-color 0.15s;
        }
        .search-input-box:focus-within {
            border-color: var(--color-primary);
            background: #FFFFFF;
        }
        .search-input-box input {
            border: none;
            outline: none;
            font-size: 13px;
            color: #0f1115;
            width: 100%;
            background: transparent;
            font-family: inherit;
        }
        .search-input-box input::placeholder {
            color: #7d8491;
        }
        .dropdown-items-container {
            max-height: 280px;
            overflow-y: auto;
        }
        .dropdown-items-container::-webkit-scrollbar {
            width: 5px;
        }
        .dropdown-items-container::-webkit-scrollbar-thumb {
            background: #D1D5DB;
            border-radius: 4px;
        }
        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 9px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px;
            color: #374151;
            transition: background 0.15s;
        }
        .dropdown-item:hover {
            background: #f6f7f9;
            color: #0f1115;
        }
        .dropdown-item.selected {
            background: #eef1ff;
            color: var(--color-primary);
            font-weight: 600;
        }
        .item-flag {
            font-size: 13px;
            line-height: 1;
            width: 20px;
            display: inline-block;
        }
        .item-name {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .item-code {
            font-size: 11px;
            font-weight: 600;
            color: #7d8491;
            background: #f6f7f9;
            padding: 1px 5px;
            border-radius: 4px;
        }

        /* PAGE TITLE SECTION (Clean, crisp, no emojis/buzzwords) */
        .page-header-section {
            margin-bottom: 24px;
        }
        .page-title {
            font-size: 28px;
            font-weight: 700;
            color: #0f1115;
            letter-spacing: -0.02em;
            margin-bottom: 6px;
        }
        .page-subtitle {
            font-size: 14px;
            color: var(--color-text-secondary);
        }

        /* TABLE CONTAINER (Crisp rectangular card, 8px border-radius) */
        .table-container {
            background: #FFFFFF;
            border: 1px solid var(--color-border);
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
            overflow: hidden;
        }
        .data-table {
            width: 100%;
            border-collapse: collapse;
            text-align: left;
        }
        .data-table th {
            background: #f6f7f9;
            padding: 13px 20px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            color: var(--color-text-muted);
            border-bottom: 1px solid var(--color-border);
        }
        .data-table td {
            padding: 14px 20px;
            border-bottom: 1px solid #f6f7f9;
            vertical-align: middle;
            font-size: 14px;
        }
        .table-row {
            cursor: pointer;
            transition: background 0.12s ease;
        }
        .table-row:hover {
            background: #f6f7f9;
        }
        .table-row:last-child td {
            border-bottom: none;
        }

        /* RANK COLUMN (Crisp, clean typography - no bubbly gold gradients) */
        .col-rank {
            width: 80px;
        }
        .rank-number {
            font-weight: 700;
            color: #555d6b;
            font-size: 13.5px;
        }

        /* WEBSITE CELL */
        .site-cell {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .site-favicon {
            width: 22px;
            height: 22px;
            border-radius: 4px;
            background: #f6f7f9;
            flex-shrink: 0;
        }
        .site-meta {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .site-name {
            font-weight: 600;
            color: var(--color-primary);
            text-decoration: none;
            font-size: 14.5px;
        }
        .site-name:hover {
            text-decoration: underline;
        }
        .site-note {
            font-size: 11.5px;
            color: var(--color-text-muted);
        }

        /* CATEGORY TAG (Clean, professional neutral tag - no bubbly colors) */
        .category-tag {
            display: inline-block;
            background: #f6f7f9;
            color: #374151;
            font-size: 12.5px;
            font-weight: 500;
            padding: 3px 10px;
            border-radius: 4px;
            white-space: nowrap;
        }

        /* TRAFFIC CELL */
        .traffic-cell {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .traffic-value {
            font-weight: 700;
            color: #0f1115;
            font-size: 14.5px;
        }
        .traffic-change {
            font-size: 12px;
            font-weight: 600;
        }

        /* ACTION LINK */
        .action-link {
            display: inline-block;
            color: var(--color-primary);
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
            padding: 5px 10px;
            border-radius: 5px;
            background: #eef1ff;
            transition: background 0.15s;
            white-space: nowrap;
        }
        .action-link:hover {
            background: #d5dcff;
        }

        /* PAGINATION SECTION (Crisp, clean buttons) */
        .pagination-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 20px;
            background: #FFFFFF;
            border-top: 1px solid var(--color-border);
            flex-wrap: wrap;
            gap: 12px;
        }
        .counter-text {
            font-size: 13px;
            color: var(--color-text-muted);
            font-weight: 500;
        }
        .pagination-nav {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .nav-btn {
            background: #FFFFFF;
            border: 1px solid var(--color-border);
            border-radius: 5px;
            min-width: 32px;
            height: 32px;
            padding: 0 8px;
            font-size: 13px;
            font-weight: 500;
            color: #374151;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: all 0.12s;
        }
        .nav-btn:hover:not(:disabled):not(.active) {
            background: #f6f7f9;
            border-color: #D1D5DB;
            color: #0f1115;
        }
        .nav-btn.active {
            background: #0f1115;
            border-color: #0f1115;
            color: #FFFFFF;
            font-weight: 600;
        }
        .nav-btn:disabled {
            color: #7d8491;
            border-color: #e3e5e9;
            background: #f6f7f9;
            cursor: not-allowed;
        }
        .nav-ellipsis {
            color: #7d8491;
            font-size: 13px;
            padding: 0 3px;
        }

        /* EMPTY STATE */
        .empty-row {
            text-align: center;
            padding: 48px 20px !important;
            color: var(--color-text-muted);
            font-size: 14px;
        }
        .reset-link {
            color: var(--color-primary);
            font-weight: 600;
            text-decoration: underline;
            cursor: pointer;
            margin-left: 6px;
        }

        /* CONTENT SECTIONS (Clean, authoritative, non-bubbly) */
        .content-section {
            margin-top: 48px;
        }
        .section-header {
            margin-bottom: 20px;
        }
        .section-title {
            font-size: 22px;
            font-weight: 700;
            color: #0f1115;
            letter-spacing: -0.01em;
            margin-bottom: 6px;
        }
        .section-desc {
            font-size: 14px;
            color: var(--color-text-secondary);
            line-height: 1.5;
            max-width: 760px;
        }

        /* USE CASES GRID */
        .use-cases-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 16px;
        }
        .use-case-card {
            background: #FFFFFF;
            border: 1px solid var(--color-border);
            border-radius: 8px;
            padding: 22px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: border-color 0.15s, box-shadow 0.15s;
        }
        .use-case-card:hover {
            border-color: #CBD5E1;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        }
        .use-case-title {
            font-size: 15.5px;
            font-weight: 600;
            color: #0f1115;
        }
        .use-case-body {
            font-size: 13.5px;
            color: #555d6b;
            line-height: 1.6;
        }

        /* FAQ LIST */
        .faq-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .faq-card {
            background: #FFFFFF;
            border: 1px solid var(--color-border);
            border-radius: 8px;
            padding: 20px 22px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: border-color 0.15s;
        }
        .faq-card:hover {
            border-color: #CBD5E1;
        }
        .faq-question {
            font-size: 15px;
            font-weight: 600;
            color: #0f1115;
        }
        .faq-answer {
            font-size: 13.5px;
            color: #555d6b;
            line-height: 1.6;
        }

/* Index-only performance and responsive layer. */
:root {
  --ui-bg: #f4f5f7;
  --ui-surface: #fff;
  --ui-border: #e3e5e9;
  --ui-border-soft: #eceef1;
  --ui-ink: #0f1115;
  --ui-muted: #555d6b;
  --ui-subtle: #7d8491;
  --ui-blue: #2e4be0;
  --ui-blue-soft: #eef1ff;
  --ui-green: #13894f;
  --ui-red: #d93036;
  --ui-radius: 6px;
  --ui-shadow: 0 1px 2px rgb(16 24 40 / 4%);
  font-variant-numeric: tabular-nums;
}
html { background: var(--ui-bg); }
body { background: var(--ui-bg) !important; color: var(--ui-ink) !important; font-family: Inter, "Segoe UI", Arial, sans-serif !important; line-height: 1.5; }
.main-wrapper { width: min(1170px, calc(100% - 32px)); max-width: 1170px; margin: 0 auto 56px; padding: 6px 0 0; }
.page-header-section { margin: 0 0 18px; }
.page-title { color: var(--ui-ink); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: clamp(25px, 3vw, 34px); font-weight: 650; letter-spacing: -.035em; line-height: 1.18; }
.page-subtitle { color: var(--ui-muted); font-size: 14px; }
.page-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 10px; color: var(--ui-subtle); font-size: 12px; }
.page-meta-row a { color: var(--ui-blue); text-decoration: underline; text-underline-offset: 2px; }
.filter-sticky-bar { position: sticky; top: 10px; z-index: 20; justify-content: flex-start; margin: 0 0 16px; }
.filter-controls-card { display: flex; flex-wrap: wrap; width: 100%; gap: 8px; padding: 10px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: #fff; box-shadow: 0 8px 22px rgb(16 24 40 / 8%); }
.domain-search-wrap { display: flex; flex: 1 1 220px; min-width: min(100%, 220px); align-items: center; gap: 8px; height: 40px; padding: 0 11px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: #fff; }
.domain-search-wrap:focus-within { border-color: var(--ui-blue); box-shadow: 0 0 0 2px rgb(36 86 166 / 12%); }
.domain-search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ui-ink); font: inherit; font-size: 13px; }
.mode-switcher { border-radius: 4px; background: #f0f2f5; }
.mode-btn { min-height: 40px; border-radius: 3px; }
.mode-btn[aria-pressed="true"] { background: #fff; color: var(--ui-ink); box-shadow: 0 1px 2px rgb(16 24 40 / 10%); }
.dropdown-trigger-btn { min-height: 40px; border-radius: var(--ui-radius); background: #fff; }
.dropdown-trigger-btn[aria-expanded="true"] .chevron-icon { transform: rotate(180deg); }
.dropdown-menu-panel { border-radius: var(--ui-radius); box-shadow: 0 8px 24px rgb(16 24 40 / 12%); }
.dropdown-menu-panel.open { display: block; }
.dropdown-item { width: 100%; border: 0; background: transparent; text-align: left; font-family: inherit; }
.dropdown-item:focus-visible { outline: 2px solid var(--ui-blue); outline-offset: -2px; }
.table-container { scroll-margin-top: 76px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: #fff; box-shadow: var(--ui-shadow); overflow: visible; }
.table-scroll { overflow-x: auto; border-radius: var(--ui-radius) var(--ui-radius) 0 0; }
.data-table { min-width: 760px; font-family: inherit; }
.data-table thead, .data-table th { position: sticky; top: 0; z-index: 3; }
.data-table th { background: #f4f5f7; color: var(--ui-muted); font-size: 11px; letter-spacing: .055em; white-space: nowrap; }
.data-table th[role="button"] { cursor: pointer; user-select: none; }
.data-table th[role="button"]::after { content: "↕"; margin-left: 7px; color: #98a2b3; }
.data-table th[role="button"][aria-sort="ascending"]::after { content: "↑"; color: var(--ui-blue); }
.data-table th[role="button"][aria-sort="descending"]::after { content: "↓"; color: var(--ui-blue); }
.table-row { cursor: default; }
.table-row:hover { background: #f7f9fc; }
.rank-number { color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.site-name, .action-link { color: var(--ui-blue); }
.site-favicon { border: 1px solid var(--ui-border-soft); }
.category-tag { background: transparent; border: 1px solid var(--ui-border); color: var(--ui-muted); padding: 2px 7px; font-size: 11px; }
.traffic-change.is-positive { color: var(--ui-green); }
.traffic-change.is-negative { color: var(--ui-red); }
.action-link { padding: 4px 0; background: transparent; border-radius: 0; }
.action-link:hover { text-decoration: underline; background: transparent; }
.pagination-bar { border-color: var(--ui-border); }
.nav-btn { min-width: 40px; height: 40px; border-radius: 4px; }
.reset-link { border: 0; background: transparent; font: inherit; }
:where(a, button, input, select, summary):focus-visible { outline: 2px solid var(--ui-blue); outline-offset: 2px; }

@media (max-width: 760px) {
  .main-wrapper { margin-bottom: 36px; }
  .filter-sticky-bar { position: static; margin-bottom: 12px; }
  .filter-controls-card { align-items: stretch; }
  .domain-search-wrap, .mode-switcher { flex: 1 1 100%; }
  .mode-switcher { display: flex; }
  .mode-btn { flex: 1; min-height: 44px; }
  .dropdown-wrapper { flex: 1 1 calc(50% - 4px); }
  .dropdown-trigger-btn { width: 100%; min-height: 44px; justify-content: space-between; }
  .dropdown-menu-panel { width: min(300px, calc(100vw - 28px)); left: 0; right: auto; }
  #categoryDropdownContainer .dropdown-menu-panel { left: auto; right: 0; }
  .dropdown-item { min-height: 44px; }
  .table-container { overflow: visible; border: 0; box-shadow: none; background: transparent; }
  .table-scroll { overflow: visible; }
  .data-table, .data-table tbody { display: block; width: 100%; min-width: 0; }
  .data-table thead { display: none; }
  .data-table tbody { display: grid; gap: 8px; }
  .data-table .table-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 12px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: #fff; }
  .data-table td { display: block; min-width: 0; padding: 0; border: 0; font-size: 13px; }
  .data-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--ui-subtle); font-size: 10px; font-weight: 600; letter-spacing: .045em; text-transform: uppercase; }
  .data-table td.col-rank { grid-column: 2; grid-row: 1; text-align: right; }
  .data-table td.col-website { grid-column: 1; grid-row: 1; }
  .data-table td.col-category { grid-column: 1; grid-row: 2; }
  .data-table td.col-traffic { grid-column: 1; grid-row: 3; }
  .data-table td.col-action { grid-column: 2; grid-row: 3; align-self: end; }
  .data-table td.col-action::before { content: none; }
  .site-favicon { width: 20px; height: 20px; }
  .pagination-bar { padding: 12px 0; }
  .nav-btn { min-width: 44px; height: 44px; }
}

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