:root {
    --brand: #0aac6a;
    --bg: #f8f9fa;
    --fg: #374151;
    --muted: #6b7280;
    --sidebar-bg: radial-gradient(1000px 600px at 10% -10%, rgba(10, 172, 106, 0.10), transparent 60%),
    radial-gradient(900px 500px at 120% 110%, rgba(10, 172, 106, 0.08), transparent 60%),
    #ffffff;
    --sidebar-text: #111111;
    --hover-bg: rgba(255, 255, 255, 0.1);
    --active-bg: rgba(10, 172, 106, 0.15);
    --card-bg: #ffffff;
    --border: #d1d5db;
    --hover-accent: #0aac6a;
    --btn-secondary-bg: #e5e7eb
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Roboto', sans-serif !important;
    background-color: var(--bg);
    color: var(--fg);
    line-height: 1.5;
}

h6, .h6, h5, .h5, h4, .h4, h3, .h3, h2, .h2, h1, .h1 {
    font-weight: 600;
}

small, .small {
    font-size: 0.833em;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 24px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.logo {
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: clamp(18px, 2.3vw, 28px);
    user-select: none;
    text-rendering: geometricPrecision;
    line-height: 1;
    margin-bottom: 32px;
}

.logo .brand {
    color: #000;
    text-transform: uppercase;
}

.logo .tld {
    color: var(--brand);
    text-transform: lowercase;
}

.slogan {
    color: var(--brand);
    font-size: 16px;
    letter-spacing: 0;
}

.slogan a {
    color: inherit;
    text-decoration: none;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-title {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--sidebar-text);
    text-decoration: none;
}

.nav-item:hover {
    background: var(--hover-bg);
}

.nav-item.active {
    background: var(--active-bg);
    font-weight: 500;
}

.nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    opacity: 0.8;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--fg);
}

.stat-value {
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    position: relative;
    background: var(--bg);
    color: var(--fg);
}

.auth-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.limits-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.limits-badge__item {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.stat-item--limit {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 4px;
}

.limit-cost-hint {
    font-size: 13px;
    color: var(--muted);
    margin: 6px 0 10px;
}

.limit-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1050;
    align-items: center;
    justify-content: center;
}

.limit-modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.limit-modal__icon {
    font-size: 40px;
}

.limit-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--fg);
}

.limit-modal__body {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.auth-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--fg);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn:hover {
    border-color: var(--hover-accent);
    color: var(--hover-accent);
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--brand) 0%, #00C48C 100%);
    color: white;
    border-color: transparent;
}

.auth-btn.primary:hover {
    box-shadow: 0 4px 12px rgba(79, 125, 243, 0.3);
    color: white;
}

.header {
    margin-bottom: 32px;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 8px;
}

.header p {
    color: var(--muted);
    font-size: 16px;
}

.analysis-blocks {
    margin-bottom: 32px;
}

.analysis-block {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.block-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.block-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--brand) 0%, #00C48C 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.block-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--fg);
}

.block-description {
    color: var(--muted);
    font-size: 14px;
    margin: -8px 0 16px;
}

.link-secondary {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: underline;
}

.link-secondary:hover {
    color: var(--brand);
}

.region-tree-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
}

.region-tree-link:hover {
    color: var(--brand);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    color: var(--fg);
    background: var(--card-bg);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--hover-accent);
    box-shadow: 0 0 0 3px rgba(79, 125, 243, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-help {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px
}

.settings-row--url-query {
    grid-template-columns: 1fr 1fr;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: normal;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, #00C48C 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(10, 172, 106, 0.25);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--fg);
}

.btn-secondary:hover {
    background: rgba(243, 244, 246, 0.8);
    color: var(--fg);
}

.btn-icon {
    margin-right: 8px;
}

.info-block {
    background: rgba(10, 172, 106, 0.1);
    border: 1px solid rgba(10, 172, 106, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-top: 32px;
    margin-bottom: 20px;
    color: var(--fg);
}

.info-title {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--brand);
    margin-bottom: 8px;
}

.info-list {
    list-style: none;
    color: var(--brand);
}

.info-list li {
    margin-bottom: 4px;
    padding-left: 16px;
    position: relative;
}

.info-list li:before {
    content: "•";
    position: absolute;
    left: 0;
}

.results-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--fg);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.results-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--fg);
}

.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.progress-wrapper {
    margin-bottom: 4px;
}

.progress-status-label {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hover-accent), #0aac6a);
    width: 0;
    transition: width 0.3s ease;
}

/* Status-specific fill colors */
.progress-wrapper[data-status="1"] .progress-fill {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.progress-wrapper[data-status="2"] .progress-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    animation: progress-pulse 1.5s ease-in-out infinite;
}

.progress-wrapper[data-status="3"] .progress-fill,
.progress-wrapper[data-status="5"] .progress-fill {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.progress-wrapper[data-status="4"] .progress-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.progress-text {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    margin-bottom: 20px;
}

.results-table:last-child {
    margin-bottom: 0;
}

.results-table th,
.results-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.results-table th {
    background: rgba(243, 244, 246, 0.8); /* светлый фон */
    font-weight: 600;
    color: var(--fg);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
}

.results-table th a {
    color: inherit;
    text-decoration: none;
}

.results-table td {
    font-size: 14px;
    color: var(--fg);
}

.results-table .filters td {
    padding: 4px 6px;
}

.results-table .filters input,
.results-table .filters select,
.results-table .filters .form-input,
.results-table .filters .form-select {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
    height: 34px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--fg);
    width: 100%;
}

.results-table .filters .input-group {
    flex-wrap: nowrap;
}

.results-table .filters .input-group input {
    border-radius: 6px !important;
    width: 100%;
}

.results-table .filters .input-group-text,
.results-table .filters .input-group .btn {
    display: none;
}

.url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-link {
    color: var(--hover-accent);
    text-decoration: none;
}

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

.form-switch-link {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border, rgba(0, 0, 0, 0.08));
    margin-bottom: 24px;
}

.auth-tabs .auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary, #888);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s ease, border-color .15s ease;
}

.auth-tabs .auth-tab:hover {
    color: var(--fg, #111);
}

.auth-tabs .auth-tab.active {
    color: var(--brand, #0aac6a);
    border-bottom-color: var(--brand, #0aac6a);
    font-weight: 600;
}

.count-badge {
    background: rgba(79, 125, 243, 0.2);
    color: var(--hover-accent);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.type-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.type-analysis {
    background: rgba(10, 172, 106, 0.1);
    color: var(--brand);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-completed {
    background: rgba(10, 172, 106, 0.1);
    color: var(--brand);
}

.status-processed {
    background: rgba(255, 195, 0, 0.1);
    color: #92400e;
}

.status-failed {
    background: rgba(255, 0, 0, 0.1);
    color: #991b1b;
}

.status-new {
    background: rgba(79, 125, 243, 0.1);
    color: var(--hover-accent);
}

.status-cancelled {
    background: var(--btn-secondary-bg);
    color: var(--fg);
}

.result-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
}

.result-icon.completed {
    background: rgba(10, 172, 106, 0.1);
    color: var(--brand);
}

.result-icon.report {
    background: rgba(79, 125, 243, 0.2);
    color: var(--hover-accent);
}

.result-icon.ai {
    background: rgba(155, 120, 255, 0.1);
    color: #5b21b6;
}

.result-icon.processed {
    background: rgba(255, 195, 0, 0.1);
    color: #92400e;
}

.result-icon.failed {
    background: rgba(255, 0, 0, 0.1);
    color: #991b1b;
}

.result-icon.new {
    background: rgba(79, 125, 243, 0.1);
    color: var(--hover-accent);
}

.result-icon.cancelled {
    background: var(--btn-secondary-bg);
    color: var(--fg);
}

.cost-badge {
    background: rgba(79, 125, 243, 0.1);
    color: var(--hover-accent);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.cost-badge.error {
    background: rgba(255, 0, 0, 0.1);
    color: #991b1b;
}

.action-buttons {
    display: flex;
    gap: 4px;
}

.btn-icon-small {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--btn-secondary-bg);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-icon-small:hover:not(:disabled) {
    background: var(--hover-bg);
}

.btn-icon-small:disabled,
.btn-icon-small.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.match-indicator {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.match-yes {
    color: var(--brand);
}

.match-no {
    color: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.3;
}

/* === Compact result rows === */
.filters-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    align-items: center;
}

.filter-chip {
    padding: 4px 10px;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    background: var(--card-bg);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--brand);
}

.filter-chip select {
    border: none;
    background: none;
    font-size: 11px;
    color: inherit;
    outline: none;
    cursor: pointer;
}

.filter-chip input {
    border: none;
    background: none;
    outline: none;
    font-size: 11px;
    width: 100%;
    color: var(--fg);
}

.filter-chip input::placeholder {
    color: var(--muted);
}

.rc {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    transition: background 0.1s;
}

.rc:hover {
    background: #fafafa;
}

.rc-bar {
    flex-shrink: 0;
    width: 4px;
    height: 28px;
    border-radius: 2px;
}

.rc-bar--ok { background: var(--brand); }
.rc-bar--err { background: #ef4444; }
.rc-bar--run { background: #f59e0b; }
.rc-bar--new { background: #3b82f6; }
.rc-bar--cancel { background: #9ca3af; }

.rc-date {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 11px;
    width: 70px;
    white-space: nowrap;
}

.rc-badges {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.b {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.b-grp { background: #f0f0f0; color: var(--fg); }
.b-type { background: rgba(10, 172, 106, 0.1); color: #166534; }
.b-ok { background: rgba(10, 172, 106, 0.08); color: #166534; font-weight: 600; }
.b-err { background: rgba(239, 68, 68, 0.08); color: #991b1b; font-weight: 600; }
.b-new { background: rgba(59, 130, 246, 0.08); color: #1d4ed8; font-weight: 600; }
.b-run { background: rgba(245, 158, 11, 0.08); color: #92400e; font-weight: 600; }
.b-cancel { background: #f0f0f0; color: #6b7280; font-weight: 600; }
.b-cache { background: rgba(245, 158, 11, 0.1); color: #92400e; cursor: help; }
.b-fresh { background: rgba(10, 172, 106, 0.1); color: #166534; cursor: help; }
.b-device { background: #f0f0f0; color: var(--fg); cursor: help; }
.b-js { background: rgba(59, 130, 246, 0.1); color: #1d4ed8; cursor: help; }

/* Always-visible compact "main settings" chip row under the report header */
.report-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 5px 20px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.report-chips .b {
    font-size: 10px;
    padding: 2px 7px;
    line-height: 1.5;
}

.report-chip--url {
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 10px;
    color: var(--brand);
    text-decoration: none;
}

.report-chip--url:hover {
    text-decoration: underline;
}

/* ⚙️ settings button active state */
.ra.active {
    border-color: var(--brand);
    background: rgba(10, 172, 106, 0.1);
}

/* Settings drawer toggled from the header ⚙️ button */
.settings-drawer {
    max-height: 0;
    overflow: hidden;
    background: #fff;
    transition: max-height 0.3s ease;
}

.settings-drawer.open {
    max-height: 600px;
    border-bottom: 1px solid #f0f0f0;
}

.settings-list {
    list-style: none;
    margin: 0;
    padding: 10px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 24px;
}

.settings-list li {
    font-size: 12px;
    line-height: 1.5;
    color: var(--fg);
}

.settings-list strong {
    color: var(--muted);
    font-weight: 600;
}

.rc-url {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-url a {
    color: var(--brand);
    text-decoration: none;
    font-size: 12px;
}

.rc-url a:hover {
    text-decoration: underline;
}

.rc-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.rc-cost {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg);
    white-space: nowrap;
}

.rc-user {
    font-size: 10px;
    color: #6366f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.rc-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.rc-act {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 1px solid #eee;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    text-decoration: none;
}

.rc-act:hover {
    border-color: var(--brand);
    background: rgba(10, 172, 106, 0.05);
}

.rc-progress-inline {
    width: 50px;
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
    flex-shrink: 0;
    overflow: hidden;
}

.rc-progress-inline .bar {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--brand), #06d6a0);
    animation: rc-pulse 2s ease-in-out infinite;
}

@keyframes rc-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.rc-step {
    font-size: 10px;
    color: var(--muted);
    font-style: italic;
    white-space: nowrap;
}

/* Report header bar */
.report-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(10, 172, 106, 0.06), rgba(6, 214, 160, 0.04));
    border-bottom: 1px solid #e8f5e9;
}

.report-status {
    font-size: 20px;
    flex-shrink: 0;
}

.report-info {
    flex: 1;
    min-width: 0;
}

.report-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
}

.report-meta {
    font-size: 11px;
    color: var(--muted);
}

.report-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.ra {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.15s;
}

.ra:hover {
    border-color: var(--brand);
    background: rgba(10, 172, 106, 0.05);
}

/* Report tab bar */
.report-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    padding: 0 20px;
    background: var(--card-bg);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.report-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.report-tab:hover {
    color: var(--fg);
}

.report-tab--active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 600;
}

.report-tab--disabled {
    opacity: 0.35;
    cursor: default;
}

.report-tab--disabled:hover {
    color: var(--muted);
}

/* Mobile result cards */
.m-card {
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--card-bg);
}

.m-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.m-bar {
    width: 3px;
    height: 20px;
    border-radius: 2px;
    flex-shrink: 0;
}

.m-url {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 6px;
}

.m-actions {
    display: flex;
    gap: 4px;
}

.m-btn {
    flex: 1;
    padding: 6px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    background: var(--card-bg);
    text-decoration: none;
    color: var(--fg);
}

.m-btn:hover {
    border-color: var(--brand);
}

.m-btn--p {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.rc-mobile {
    display: none;
}

.results-count {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 10px;
}

.pg {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    background: var(--card-bg);
    color: var(--fg);
}

.pg.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.select2-container--krajee-bs5 .select2-selection--single {
    height: calc(2.25rem + 8px);
    line-height: 2.2;
    padding: 0.375rem 1.5rem 0.375rem 0.5rem;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--fg);
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    justify-content: center;
    gap: 8px;
}

.pagination li {
    display: inline-block;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    background: var(--card-bg);
    color: var(--fg);
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.pagination li a:hover {
    background-color: var(--hover-bg);
    border-color: rgba(0, 0, 0, 0.1);
}

.pagination li.active span,
.pagination li.active a {
    background: linear-gradient(135deg, var(--brand) 0%, #00C48C 100%);
    color: #fff;
    border-color: #00C48C;
    cursor: default;
    border-radius: 8px;
}

.pagination li.disabled span {
    color: rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 0.1);
    cursor: not-allowed;
}

.pagination li.prev a,
.pagination li.next a {
    font-weight: bold;
}

.filters input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    background: var(--card-bg);
    color: var(--fg);
}

.td-updated-at {
    position: relative;
}

.datetimepicker {
    display: none;
    position: absolute;
    z-index: 20;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--fg);
}

.grid-view {
    overflow-x: auto;
}

/* Toggle buttons for analysis types */
.toggle-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toggle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    flex: 1 1 0;
    min-width: 80px;
    text-align: center;
}

.toggle-btn:hover {
    border-color: var(--brand);
    background: rgba(10, 172, 106, 0.03);
}

.toggle-btn.active {
    border-color: var(--brand);
    background: var(--active-bg);
    color: #1b5e20;
    font-weight: 600;
}

.toggle-btn .toggle-icon {
    font-size: 22px;
    line-height: 1;
}

.toggle-btn input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-btn--all {
    border-style: dashed;
    color: var(--muted);
    min-width: 70px;
}

.toggle-btn--all.active {
    border-style: solid;
    color: #1b5e20;
}

/* Experimental / opt-in analysis type (e.g. JS rendering comparison) */
.toggle-btn--experimental {
    border-style: dashed;
    border-color: #f5a623;
}

.toggle-btn--experimental:hover {
    border-color: #e6951a;
    background: rgba(245, 166, 35, 0.05);
}

.toggle-btn--experimental.active {
    border-style: solid;
    border-color: #f5a623;
    background: rgba(245, 166, 35, 0.12);
    color: #8a5200;
}

/* Rendering analysis tabs in results menu — orange accent */
.report-tab.menu-item--rendering {
    border-bottom: 2px solid rgba(245, 166, 35, 0.4);
}

.report-tab.menu-item--rendering.report-tab--active {
    border-bottom-color: #f5a623;
}

/* Inline region display (chip style) */
.region-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--fg);
}

.region-inline .region-label {
    display: none;
}

.region-inline .region-value {
    font-weight: 600;
    color: var(--fg);
}

.region-inline::before {
    content: '🌍';
    font-size: 14px;
}

.region-inline .region-change {
    color: var(--brand);
    cursor: pointer;
    font-size: 11px;
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
}

.region-inline .region-change:hover {
    text-decoration: underline;
    color: #087f4f;
}

.region-picker {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.region-picker.open {
    max-height: 600px;
    margin-bottom: 12px;
    overflow: visible;
}

/* Switchable chips row */
.settings-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.switch-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--fg);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    position: relative;
}

.switch-chip:hover {
    border-color: var(--brand);
    background: rgba(10, 172, 106, 0.05);
}

.switch-chip .chip-icon {
    font-size: 14px;
}

.switch-chip .chip-value {
    font-weight: 600;
}

.switch-chip .chip-arrow {
    font-size: 9px;
    color: var(--muted);
    margin-left: 2px;
}

.chip-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
}

.chip-dropdown.open {
    display: block;
}

.chip-option {
    padding: 9px 14px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.1s;
}

.chip-option:hover {
    background: var(--bg);
}

.chip-option.active {
    background: var(--active-bg);
    color: #1b5e20;
    font-weight: 600;
}

/* Expandable sections */
.expand-section {
    margin-bottom: 12px;
}

.expand-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    transition: color 0.2s;
}

.expand-trigger:hover {
    color: var(--brand);
}

.expand-trigger .arrow {
    transition: transform 0.2s;
    font-size: 10px;
}

.expand-trigger.open .arrow {
    transform: rotate(90deg);
}

.expand-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.expand-body.open {
    max-height: 2000px;
    overflow: visible;
    padding-top: 12px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-checkbox--privacy {
    background: none;
    border: none;
    padding: 0;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    justify-content: flex-start;
}

.form-checkbox--privacy:hover {
    background: none;
    border-color: transparent;
}

.form-checkbox--privacy input[type="checkbox"] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.form-checkbox--advanced {
    margin-top: 30px;
}

.form-checkbox--advanced span {
    word-break: break-word;
}

.form-checkbox:hover {
    border-color: var(--hover-accent);
    background: rgba(10, 172, 106, 0.03);
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.advanced-settings {
    max-height: 0;
    overflow: hidden;
    text-align: left;
    transition: max-height 0.3s ease;
}

.advanced-settings.open {
    max-height: 3000px;
    margin-top: 15px;
    overflow: visible;
}

.select2-selection__clear {
    display: none;
}

.invalid-feedback {
    color: red;
}

.limit-reached input,
.limit-reached select {
    border-color: red;
}

#usersTable td {
    white-space: nowrap;
}

#regionTree {
    margin-top: 5px;
    max-height: 400px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.select2-container--krajee-bs5 #select2-regionSearch-results li.select2-results__option {
    color: var(--sidebar-text);
    background-color: var(--active-bg);
}

.settings-row--analysis {
    grid-template-columns: 1fr 1fr;
}

.settings-row--analysis .form-checkbox {
    margin-top: 0;
}

.analysis-button {
    display: none;
}

.analysis-button.active {
    display: block;
}

.analysis-report {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    margin-top: 20px;
    overflow: auto;
}

.analysis-report--comparison th,
.analysis-report--comparison td {
    max-width: 100px;

}

.analysis-report h1,
.analysis-report h2,
.analysis-report h3 {
    color: var(--fg);
    margin-bottom: 16px;
    font-weight: 600;
}

.analysis-report h1 {
    font-size: 28px;
}

.analysis-report h2 {
    font-size: 22px;
    border-bottom: 2px solid var(--brand);
    padding-bottom: 6px;
}

.analysis-report h3 {
    font-size: 18px;
    margin-top: 24px;
}

.analysis-report ul {
    margin: 12px 0 20px 24px;
}

.analysis-report li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.analysis-report table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.analysis-report table th,
.analysis-report table td {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.analysis-report th:last-child,
.analysis-report td:last-child {
    border-right: none;
}

.analysis-report tr:last-child td {
    border-bottom: none;
}

.analysis-report table th {
    text-align: left;
    background: var(--brand);
    color: #fff;
    padding: 10px 14px;
    font-weight: 500;
}

.analysis-report table th:first-child {
    border-top-left-radius: 8px;
}

.analysis-report table th:last-child {
    border-top-right-radius: 8px;
}

.analysis-report table td {
    padding: 10px 14px;
    word-break: break-word;
}

.analysis-report table tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.analysis-report .word-cloud span {
    display: inline-block;
    margin: 3px 6px;
    background: rgba(10, 172, 106, .08);
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--fg);
    white-space: nowrap;
}

.analysis-report a {
    color: var(--hover-accent);
    text-decoration: none;
}

.analysis-report a:hover {
    text-decoration: underline;
}

.analysis-report ul a {
    font-weight: 500;
}

.analysis-report p,
.analysis-report > ul,
.analysis-report > table {
    margin-bottom: 24px;
}

.analysis-report #competitors table a {
    font-weight: 500;
}

.analysis-report .empty-text {
    margin-bottom: 0;
}

.analysis-report .nav-tabs {
    display: flex;
    gap: 8px;
    margin: 0;
    list-style: none;
    padding: 0;
}

.analysis-report .nav-tabs li {
    flex: 1;
    margin-bottom: 0;
    padding: 0;
}

.analysis-report .nav-tabs a {
    text-align: center;
    padding: 10px 16px;
    border-radius: 8px 8px 0 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-bottom: none;
    color: var(--fg);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 0;
}

.analysis-report .nav-tabs a.active,
.analysis-report .nav-tabs a:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.analysis-report .tab-content {
    background: var(--card-bg);
    overflow: auto;
}

.analysis-report .tab-content form {
    margin: 10px 0;
}

.analysis-report .tab-content .btn {
    margin-top: 5px;
}

.analysis-report .tab-content table {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.analysis-report .tab-content a {
    color: inherit;
}

.analysis-report .tab-content table th:first-child {
    border-top-left-radius: 0;
}

.analysis-report .tab-content table th:last-child {
    border-top-right-radius: 0;
}

.analysis-report .tab {
    display: none;
}

.analysis-report .tab.active {
    display: block;
}

.analysis-report .tab-content table {
    margin: 0;
}

.mobile-header {
    display: none;
}

.select2-container--krajee-bs5 .selection .select2-selection--single {
    height: 43px;
    padding: 12px 16px;
    border-radius: 8px;
}

.results-summary {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.lang-switcher {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.lang-switcher a {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--fg);
    text-decoration: none;
    transition: all 0.2s ease;
}

.lang-switcher a:hover {
    border-color: var(--hover-accent);
    color: var(--hover-accent);
    background: rgba(10, 172, 106, 0.05);
}

.lang-switcher a.active {
    background: linear-gradient(135deg, var(--brand) 0%, #00C48C 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(10, 172, 106, 0.25);
}

footer.site {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 18px 0;
    color: var(--muted);
    font-size: 14px;
    line-height: normal;
}

.container--footer {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px);
    min-height: auto;
}

.container--footer .logo {
    font-size: 18px;
    margin-bottom: 0;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

#users-grid input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.form-select.is-invalid:not([multiple]):not([size]) {
    background-image: none;
}

.nav-parent .collapse-arrow {
    transition: transform 0.2s ease;
}

.nav-parent:not(.collapsed) .collapse-arrow {
    transform: rotate(-180deg);
}

.nav-submenu .nav-item {
    padding-left: 32px;
}

@media (max-width: 1199px) {
    .settings-row {
        display: block;
    }

    .type-badge {
        white-space: normal;
    }

    .url-cell {
        max-width: 240px;
    }

    .results-table th,
    .results-table td {
        padding: 8px;
    }

    .results-table td {
        font-size: 11px;
    }

    .analysis-report {
        padding: 15px;
    }

    .analysis-report table {
        font-size: 10px;
    }

    .analysis-report table td {
        padding: 7px 9px;
    }
}

@media (max-width: 991px) {
    .results-actions .btn {
        padding: 9px 19px;
        font-size: 11px;
    }

    .main-content,
    .results-section {
        padding: 5px;
    }

    .sidebar {
        width: 180px;
        padding: 15px;
    }

    .url-cell {
        max-width: 210px;
    }

    .results-table th,
    .results-table td {
        padding: 7px;
    }

    .results-table td {
        font-size: 10px;
    }

    .type-badge {
        font-size: 11px;
        padding: 4px 7px;
    }

    .analysis-report {
        padding: 5px;
    }

    .analysis-report h1 {
        font-size: 27px;
    }

    .header p {
        color: var(--muted);
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        width: 260px;
        background: #fff;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform .3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, .15);
        overflow-y: auto;
        padding: 60px 16px 16px;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 9998;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        height: 50px;
        padding: 0 12px;
        background: #fff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
        position: sticky;
        top: 0;
        z-index: 10000;
    }

    .burger-btn {
        font-size: 26px;
        background: none;
        border: none;
        cursor: pointer;
    }

    .main-content {
        padding: 16px;
    }

    .analysis-block {
        padding: 16px;
    }

    .auth-tabs .auth-tab {
        padding: 10px 8px;
        font-size: 14px;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-table {
        font-size: 12px;
    }

    .results-table th,
    .results-table td {
        padding: 8px 4px;
    }

    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .analysis-block .settings-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .analysis-block .settings-row .form-group {
        flex: none !important;
        width: 100%;
    }

    .analysis-block .settings-row .btn {
        width: 100%;
    }

    .toggle-group {
        gap: 6px;
    }

    .toggle-btn {
        padding: 10px 14px;
        min-width: 80px;
        font-size: 12px;
    }

    .toggle-btn .toggle-icon {
        font-size: 18px;
    }

    /* Results: desktop rows hidden, mobile cards shown */
    .rc-desktop { display: none; }
    .rc-mobile { display: block; }

    .report-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .report-status { font-size: 16px; }
    .report-title { font-size: 14px; }

    .ra { width: 28px; height: 28px; font-size: 12px; }

    .report-tabs { padding: 0 12px; }
    .report-tab { padding: 8px 12px; font-size: 12px; }

    .report-chips { padding: 5px 12px; gap: 4px; }
    .report-chip--url { max-width: 200px; }
    .settings-list { grid-template-columns: 1fr; padding: 8px 12px; }
}

@media (max-width: 575px) {
    body {
        font-size: 0.7rem;
    }

    .auth-buttons {
        top: 10px;
        right: 10px;
    }

    .limits-badge {
        display: none;
    }

    .header h1 {
        font-size: 19px;
    }

    .header p {
        font-size: 14px;
    }

    .form-checkbox {
        padding: 10px 14px;
        font-size: 12px;
        height: 37px;
    }

    .toggle-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .toggle-btn {
        padding: 8px 10px;
        min-width: 0;
        font-size: 11px;
        border-radius: 8px;
    }

    .toggle-btn .toggle-icon {
        font-size: 16px;
    }

    .toggle-btn--all {
        grid-column: 1 / -1;
    }

    .region-inline {
        font-size: 13px;
        flex-wrap: wrap;
    }

    .settings-chips {
        gap: 6px;
    }

    .switch-chip {
        font-size: 12px;
        padding: 5px 10px;
    }

    .info-block {
        padding: 13px;
    }

    ol, ul {
        padding-left: 0.8rem;
    }

    .info-list li {
        padding-left: 13px;
    }

    .btn {
        font-size: 12px;
    }

    .results-actions .btn {
        font-size: 0;
    }

    .results-actions .btn-icon {
        font-size: 11px;
        margin: 0;
    }

    .settings-row--analysis {
        display: block;
    }

    .analysis-button {
        margin-bottom: 10px;
    }

    #resultsBody {
        overflow: auto;
    }

    .url-cell {
        max-width: none;
    }

    .analysis-report {
        padding: 5px;
    }

    .analysis-report h1 {
        font-size: 15px;
    }

    .analysis-report h1,
    .analysis-report h2,
    .analysis-report h3 {
        margin-bottom: 9px;
    }

    .analysis-report h2 {
        font-size: 12px;
        padding-bottom: 3px;
    }

    .analysis-report table {
        font-size: 10px;
    }

    .settings-row--analysis .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    #word-cloud {
        overflow: auto;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .advanced-settings h2 {
        font-size: 18px;
    }
    .analysis-report .nav-item {
        padding: 9px 11px;
        margin-bottom: 3px;
        font-size: 10px;
    }
}

/* ===== Inspector / Debug page ===== */

.inspector-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inspector-meta {
    background: var(--card-bg, #fff);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.inspector-meta__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
    font-size: 13px;
    color: var(--fg, #333);
}
.inspector-copy-report {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}
.inspector-copy-report:hover { background: #f0f4ff; }
.inspector-meta { position: relative; }
.inspector-meta__item strong { font-weight: 600; }
.inspector-meta__item a { color: var(--accent, #2563eb); text-decoration: none; }

.inspector-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}
.inspector-badge--on {
    background: #dcfce7;
    color: #166534;
}
.inspector-badge--off {
    background: #f3f4f6;
    color: #9ca3af;
    text-decoration: line-through;
}

/* Steps chips */
.inspector-steps {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}
.inspector-step {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--card-bg, #fff);
    border: 1px solid rgba(0,0,0,0.1);
    font-size: 12px;
    white-space: nowrap;
    text-decoration: none;
    color: var(--fg, #333);
    transition: background 0.15s, border-color 0.15s;
}
.inspector-step:hover {
    background: #f0f4ff;
    border-color: #93b4fd;
}
.inspector-step--active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.inspector-step__icon { font-size: 14px; }
.inspector-step__label { font-weight: 500; }

/* Input / Output columns */
.inspector-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 900px) {
    .inspector-columns { grid-template-columns: 1fr; }
}
.inspector-col {
    background: var(--card-bg, #fff);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
}
.inspector-col__header {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    background: #f8fafc;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.inspector-col__body {
    padding: 12px 16px;
    max-height: 600px;
    overflow-y: auto;
    font-size: 13px;
}
.inspector-empty {
    color: #9ca3af;
    font-style: italic;
    margin: 0;
}

/* Data tree */
.inspector-tree {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
}
.inspector-tree > li { margin: 2px 0; }
.inspector-tree summary {
    cursor: pointer;
    padding: 2px 0;
}
.inspector-tree summary:hover { color: #2563eb; }
.inspector-tree__count {
    color: #9ca3af;
    font-weight: 400;
    font-size: 11px;
}
.inspector-tree__size {
    color: #9ca3af;
    font-size: 11px;
}
.inspector-tree__node--new {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    padding-left: 6px;
    margin-left: -6px;
    border-radius: 2px;
}
.inspector-value {
    word-break: break-all;
    color: #374151;
}
.inspector-value--truncated {
    color: #6b7280;
}
.inspector-value--empty {
    color: #d1d5db;
    font-style: italic;
}
.inspector-value--full {
    color: #374151;
}
.inspector-value--expanded + .inspector-expand-btn { display: none; }
.inspector-expand-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0 6px;
    font-size: 10px;
    cursor: pointer;
    margin-left: 4px;
    color: #6b7280;
}
.inspector-expand-btn:hover { background: #f3f4f6; }

/* Variables snapshot */
.inspector-vars {
    background: var(--card-bg, #fff);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
}
.inspector-vars__header {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}
.inspector-vars__header:hover { background: #f1f5f9; }
.inspector-vars__count {
    font-weight: 400;
    color: #6b7280;
    font-size: 12px;
}
.inspector-vars__body {
    max-height: 500px;
    overflow-y: auto;
}
.inspector-vars__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.inspector-vars__table th {
    text-align: left;
    padding: 5px 10px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    z-index: 1;
}
.inspector-vars__table td {
    padding: 4px 10px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}
.inspector-vars__table code {
    font-size: 11px;
    color: #1e40af;
}
.inspector-vars__type {
    display: inline-block;
    padding: 0 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    background: #e5e7eb;
    color: #374151;
}
.inspector-vars__size {
    font-family: monospace;
    white-space: nowrap;
    color: #6b7280;
    text-align: right;
}
.inspector-vars__preview {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
    font-family: monospace;
    font-size: 11px;
}
.inspector-vars__row--empty {
    opacity: 0.45;
}
.inspector-vars__row--empty code {
    color: #9ca3af;
}
.inspector-copy {
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.inspector-copy:hover {
    background: #dbeafe;
    color: #1e40af;
}
.inspector-copy--ok {
    background: #dcfce7 !important;
    color: #166534 !important;
}

/* Audit logs table */
.inspector-logs {
    background: var(--card-bg, #fff);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
}
.inspector-logs__header {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    background: #f8fafc;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.inspector-logs__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.inspector-logs__table th {
    text-align: left;
    padding: 6px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.inspector-logs__table td {
    padding: 5px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}
.inspector-logs__time {
    font-family: monospace;
    white-space: nowrap;
    color: #6b7280;
}
.inspector-logs__num {
    font-family: monospace;
    white-space: nowrap;
    text-align: right;
}
.inspector-logs__row--error { background: #fef2f2; }
.inspector-logs__row--warning { background: #fffbeb; }

.inspector-log-level {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.inspector-log-level--info { background: #dbeafe; color: #1e40af; }
.inspector-log-level--warning { background: #fef3c7; color: #92400e; }
.inspector-log-level--error { background: #fee2e2; color: #991b1b; }

/* Error block */
.inspector-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    overflow: hidden;
}
.inspector-error__header {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    color: #991b1b;
    background: #fee2e2;
    border-bottom: 1px solid #fecaca;
}
.inspector-error__body {
    padding: 12px 16px;
    font-size: 13px;
    color: #7f1d1d;
}
.inspector-error__body code {
    background: rgba(0,0,0,0.05);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12px;
}
.inspector-error__body > div { margin-bottom: 4px; }
.inspector-trace {
    font-size: 11px;
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin-top: 6px;
    border: 1px solid #fecaca;
    color: #4b5563;
    max-height: 300px;
}

/* ===== SEO Table (AI Scraper results) ===== */

.seo-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.seo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}
.seo-table th {
    text-align: left;
    padding: 8px 10px;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    z-index: 1;
}
.seo-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seo-table tr:hover td {
    background: #f8fafc;
}
.seo-table__num {
    width: 36px;
    text-align: center;
    color: #9ca3af;
}
.seo-table__url {
    max-width: 250px;
}
.seo-table__url a {
    color: var(--accent, #2563eb);
    text-decoration: none;
}
.seo-table__url a:hover {
    text-decoration: underline;
}
.seo-table__len {
    width: 60px;
    text-align: center;
    font-family: monospace;
}
.seo-table__warn {
    color: #dc2626;
    font-weight: 600;
}
}