:root {
    --bg-primary: #F5F5F7;
    --bg-card: #FFFFFF;
    --bg-sidebar: rgba(255, 255, 255, 0.72);
    --color-primary: #1B3A5C;
    --color-accent: #0071E3;
    --color-success: #34C759;
    --color-warning: #FF9500;
    --color-danger: #FF3B30;
    --color-text: #1D1D1F;
    --color-text-secondary: #86868B;
    --color-border: #E5E5EA;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.12);
    --radius-card: 12px;
    --radius-button: 8px;
    --radius-modal: 16px;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    transition: width 200ms ease;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar.collapsed { width: 64px; }

.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
    min-height: 64px;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo svg { color: white; width: 18px; height: 18px; }

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-primary);
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .sidebar-title { opacity: 0; width: 0; }

.sidebar-nav { flex: 1; padding: 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text-secondary);
    text-decoration: none;
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover { background: rgba(0,0,0,0.04); color: var(--color-text); }

.nav-item.active {
    background: rgba(0,113,227,0.08);
    color: var(--color-accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--color-accent);
    border-radius: 0 3px 3px 0;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.nav-item span {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .nav-item span { opacity: 0; width: 0; }
.sidebar.collapsed .nav-item .tutorial-nav-icon { opacity: 1; width: 20px; }

.sidebar-bottom {
    padding: 8px;
    border-top: 1px solid var(--color-border);
}

.sidebar-divider {
    border: none;
    border-top: 1px solid #E5E5EA;
    margin: 8px 0;
}

.sidebar-username {
    padding: 4px 12px 6px;
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tutorial-nav-item {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.tutorial-nav-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
    transition: border-color var(--transition-fast);
}

.tutorial-nav-item:hover .tutorial-nav-icon {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

#sidebar-toggle { cursor: pointer; }
#sidebar-toggle svg { width: 20px; height: 20px; }

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sections-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}


.section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    pointer-events: none;
    overflow-y: auto;
    padding: 20px 24px;
}

.section.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.section-content { max-width: 960px; margin: 0 auto; }

.card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 16px;
    transition: box-shadow var(--transition-fast);
}

.card:hover { box-shadow: var(--shadow-card-hover); }

h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

input[type="text"], input[type="password"], select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: var(--bg-primary);
    border-radius: var(--radius-button);
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text);
    outline: none;
    transition: box-shadow var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(0,113,227,0.2);
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-button);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:hover { transform: scale(1.02); }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover { background: #005bb5; }

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: 12px;
    width: 100%;
}

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius-button);
    box-shadow: 0 4px 16px rgba(0,0,0,0.16);
    padding: 12px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInRight 300ms ease;
    max-width: 360px;
    position: relative;
    overflow: hidden;
}

.toast .progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--color-accent);
    animation: shrink 4s linear forwards;
}

.toast.success .progress { background: var(--color-success); }
.toast.error .progress { background: var(--color-danger); }
.toast.warning .progress { background: var(--color-warning); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shrink {
    from { width: 100%; }
    to { width: 0%; }
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-primary);
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-modal);
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.auth-card h1 { text-align: center; margin-bottom: 4px; }
.auth-card .subtitle { text-align: center; margin-bottom: 32px; }

.error-text {
    color: var(--color-danger);
    font-size: 13px;
    margin-top: 8px;
}

.search-hero {
    text-align: center;
    padding: 16px 0 14px;
}

.search-hero h1 { font-size: 26px; margin-bottom: 6px; }
.search-hero .subtitle { margin-bottom: 0; }

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    padding: 20px;
}

#section-search {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#section-search .section-content {
    width: 100%;
}

.source-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--color-text-secondary);
    font-size: 13px;
}

.source-counter strong { color: var(--color-primary); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green { background: rgba(52,199,89,0.12); color: var(--color-success); }
.badge-yellow { background: rgba(255,149,0,0.12); color: var(--color-warning); }
.badge-red { background: rgba(255,59,48,0.12); color: var(--color-danger); }
.badge-grey { background: rgba(142,142,147,0.12); color: #8E8E93; }

.settings-section { margin-bottom: 32px; }
.settings-section h3 { margin-bottom: 16px; }
.settings-key-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0,113,227,0.12);
    color: var(--color-accent);
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    cursor: help;
    vertical-align: middle;
}

.settings-key-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-key-input-row input {
    flex: 1;
    min-width: 0;
}

.settings-key-test-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.settings-key-test-btn:hover {
    background: rgba(0,113,227,0.08);
    color: var(--color-accent);
    border-color: var(--color-accent);
    transform: none;
}

.settings-key-test-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-key-result {
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
    display: inline-block;
}

.settings-key-result.valid { color: var(--color-success); }
.settings-key-result.invalid { color: var(--color-danger); }
.settings-key-result.testing { color: var(--color-text-secondary); }

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

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
}

td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border);
}

tr:hover { background: rgba(0,0,0,0.02); }

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

.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { color: var(--color-text); margin-bottom: 8px; }

.graph-placeholder {
    background: #1A1A2E;
    border-radius: var(--radius-card);
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.4);
    font-size: 16px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,113,227,0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border);
    z-index: 100;
    padding: 4px 0;
    padding-bottom: env(safe-area-inset-bottom, 4px);
}

.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
}

.mobile-bottom-nav .nav-item {
    flex-direction: column;
    gap: 2px;
    padding: 6px 12px;
    font-size: 10px;
}

.mobile-bottom-nav .nav-item::before { display: none; }

@media (max-width: 1024px) {
    .sidebar { width: 64px; }
    .sidebar .sidebar-title { opacity: 0; width: 0; }
    .sidebar .nav-item span { opacity: 0; width: 0; }
}

/* ── Activity Feed ──────────────────────────────────────────────────────── */

.activity-feed {
    margin-top: 24px;
    background: #1A1A2E;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.activity-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.activity-feed-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-cancel {
    background: rgba(255,59,48,0.15);
    color: #FF3B30;
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-cancel:hover { background: rgba(255,59,48,0.25); }

.activity-feed-body {
    padding: 8px 0;
    max-height: 480px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.activity-feed-body::-webkit-scrollbar { width: 6px; }
.activity-feed-body::-webkit-scrollbar-track { background: transparent; }
.activity-feed-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.feed-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 16px;
    color: rgba(255,255,255,0.6);
    animation: feedSlideIn 200ms ease;
}

.feed-line.status-ok { color: #34C759; }
.feed-line.status-warning { color: #FF9500; }
.feed-line.status-error { color: #FF3B30; }
.feed-line.status-skipped { color: rgba(255,255,255,0.35); }
.feed-line.status-running { color: #0A84FF; }
.feed-line.status-busy { color: #8E8E93; opacity: 0.85; }

.feed-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    line-height: 1.5;
}

.feed-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(10,132,255,0.3);
    border-top-color: #0A84FF;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

.feed-text { flex: 1; line-height: 1.5; }

.feed-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: 6px;
}

.feed-badge-cached { background: rgba(0,113,227,0.2); color: #0A84FF; }
.feed-badge-compliance { background: rgba(255,149,0,0.15); color: #FF9500; }
.feed-badge-cybersecurity { background: rgba(52,199,89,0.15); color: #34C759; }

.activity-feed-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.feed-summary {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

.feed-summary strong { color: rgba(255,255,255,0.9); }

.btn-view-results {
    background: var(--color-accent);
    color: white;
    padding: 8px 20px;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
}

@keyframes feedSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Results Section ──────────────────────────────────────────────────── */

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

/* Score Rings */
.score-ring-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 28px 24px;
    justify-content: space-around;
    flex-wrap: wrap;
}

.score-ring-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.score-ring-wrapper {
    position: relative;
    width: 128px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-ring-wrapper svg {
    position: absolute;
    top: 0; left: 0;
}

.score-ring-value {
    position: relative;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    z-index: 1;
}

.score-ring-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
}

.score-ring-risk {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.score-ring-note {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-align: center;
    max-width: 120px;
}

/* AI Summary Card */
.ai-summary-card {
    background: linear-gradient(135deg, #F8F0FF 0%, #EDF4FF 100%);
    border: 1px solid rgba(191,90,242,0.15);
    box-shadow: 0 2px 8px rgba(191,90,242,0.08);
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.ai-summary-icon {
    font-size: 18px;
    color: #BF5AF2;
}

.ai-summary-badge {
    margin-left: auto;
    background: rgba(191,90,242,0.12);
    color: #BF5AF2;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
}

.ai-summary-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text);
    white-space: pre-wrap;
    text-align: justify;
    text-justify: inter-word;
}

/* Check Group Cards */
.results-groups { display: flex; flex-direction: column; gap: 12px; }

.check-group {
    margin-bottom: 0 !important;
}

.check-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
    border-radius: var(--radius-card);
}

.check-group-header:hover { background: rgba(0,0,0,0.02); }

.check-group-chevron {
    font-size: 20px;
    color: var(--color-text-secondary);
    transition: transform 200ms ease;
    line-height: 1;
}

.check-group-body {
    border-top: 1px solid var(--color-border);
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 300ms ease;
}

.check-group-body.collapsed {
    max-height: 0;
    border-top: none;
}

/* Check Cards */
.check-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition-fast);
}

.check-card:last-child { border-bottom: none; }
.check-card:hover { background: rgba(0,0,0,0.015); }

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.status-dot--ok      { background: var(--color-success); }
.status-dot--warning { background: var(--color-warning); }
.status-dot--error   { background: var(--color-danger); }
.status-dot--skipped { background: var(--color-border); }

.check-card-body { flex: 1; min-width: 0; }

.check-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.check-card-name-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.check-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.check-card-attribution {
    font-size: 11px;
    color: var(--color-text-secondary);
    font-weight: 400;
}

.check-card-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.check-card-detail {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

.check-badge-cached {
    display: inline-block;
    background: rgba(0,113,227,0.08);
    color: var(--color-accent);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.check-badge-severity {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sev-critical { background: rgba(255,59,48,0.12); color: var(--color-danger); }
.sev-high { background: rgba(255,59,48,0.08); color: #E03030; }
.sev-medium { background: rgba(255,149,0,0.12); color: var(--color-warning); }
.sev-low { background: rgba(255,149,0,0.08); color: #C07000; }
.sev-info { background: rgba(0,0,0,0.04); color: var(--color-text-secondary); }

/* Left border accent by status */
.check-card.status-warning { border-left: 3px solid var(--color-warning); }
.check-card.status-error { border-left: 3px solid var(--color-danger); }
.check-card.status-ok { border-left: 3px solid var(--color-success); }
.check-card.status-skipped { border-left: 3px solid var(--color-border); }

/* Combined risk banner */
.combined-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 18px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

.traffic-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.traffic-icon.traffic-green  { color: var(--color-success); }
.traffic-icon.traffic-yellow { color: var(--color-warning); }
.traffic-icon.traffic-red    { color: var(--color-danger); }

.combined-banner-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.combined-banner-score {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.combined-banner-level {
    font-size: 15px;
    font-weight: 600;
    margin-left: 4px;
}

/* Two-column ring row (legacy) */
.score-ring-row.two-col {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}
.score-ring-row.two-col .score-ring-card {
    flex: 1;
    max-width: 280px;
}

/* Dual-column results layout: ring above its checker cards */
.results-dual-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.results-dual-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.score-ring-panel {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px 16px;
    display: flex;
    justify-content: center;
}
.scores-unavailable-note {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-left: auto;
    font-style: italic;
}
.feed-summary-strip {
    font-size: 12px;
    color: var(--color-text-secondary);
    padding: 6px 12px;
    background: var(--bg-section);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

/* Check card animation */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.check-card { animation: fadeSlideIn 0.3s ease both; }

/* Busy status */
.status-dot--busy { background: #8E8E93; }
.check-card.status-busy { border-left: 3px solid #8E8E93; opacity: 0.85; }

/* Modal scale-in animation */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* OpenSanctions confidence pill */
.check-badge-confidence {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 6px;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Raw data section */
.check-card-raw {
    margin-top: 8px;
}

.btn-raw-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-raw-toggle:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.raw-panel {
    background: var(--bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    color: var(--color-text);
}
.raw-panel.collapsed { display: none; }

/* AI summary skeleton */
.ai-summary-skeleton { padding: 4px 0; }
.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #e5e5ea 25%, #f0f0f5 50%, #e5e5ea 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* AI configure prompt */
.ai-summary-configure {
    opacity: 0.8;
}

/* Feed toggle button */
.btn-ghost {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}
.btn-ghost:hover { color: rgba(255,255,255,0.9); }

.feed-toggle { font-size: 12px; }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .mobile-bottom-nav { display: block; }
    .main-content { padding-bottom: 72px; }
    .settings-grid { grid-template-columns: 1fr; }
    .search-hero { padding: 12px 0 10px; }
    .search-hero h1 { font-size: 22px; }
    .score-ring-row { padding: 20px 16px; gap: 12px; }
    .score-ring-card { min-width: 100px; }
    .score-ring-wrapper { width: 100px; height: 100px; }
    .score-ring-value { font-size: 22px; }
    .results-header { flex-direction: column; }
    .combined-banner { flex-wrap: wrap; gap: 10px; }
    .combined-banner-score { font-size: 28px; }
    .results-dual-col { grid-template-columns: 1fr; }
}

/* ── Investigation Graph Section ──────────────────────────────────────── */

#section-graph {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.graph-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 44px;
    background: #0D1B2A;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    z-index: 20;
}

.graph-toolbar-left,
.graph-toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.graph-toolbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding: 0 8px;
    scrollbar-width: none;
}

.graph-toolbar-center::-webkit-scrollbar { display: none; }

.graph-toolbar-sep {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.12);
    margin: 0 4px;
}

.graph-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    margin-right: 4px;
}

.graph-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    padding: 5px 8px;
    font-size: 12px;
    font-family: inherit;
    transition: all 150ms ease;
    white-space: nowrap;
    line-height: 1;
}

.graph-btn:hover {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    border-color: rgba(255,255,255,0.2);
}

.graph-btn svg { display: block; }

.graph-inv-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    font-family: inherit;
    padding: 5px 24px 5px 8px;
    cursor: pointer;
    max-width: 160px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.graph-inv-select:focus {
    border-color: rgba(0,113,227,0.5);
}

/* Custom multi-select dropdown */
.graph-inv-multiselect-wrap {
    position: relative;
}

.graph-inv-multiselect-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    font-family: inherit;
    padding: 5px 10px;
    cursor: pointer;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 150ms ease;
}

.graph-inv-multiselect-btn:hover {
    border-color: rgba(255,255,255,0.25);
    transform: none;
}

.graph-inv-multiselect-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.graph-inv-multiselect-btn svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.graph-inv-multiselect-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #0D1B2A;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    min-width: 200px;
    max-width: 260px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 500;
    padding: 6px 0;
    max-height: 280px;
    overflow-y: auto;
}

.graph-inv-multiselect-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    transition: background 100ms ease;
    user-select: none;
}

.graph-inv-multiselect-item:hover {
    background: rgba(255,255,255,0.07);
}

.graph-inv-multiselect-item input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.graph-inv-multiselect-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 4px 0;
}

.graph-filter-wrap {
    position: relative;
}

.graph-filter-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 300;
    background: #0D1B2A;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 220px;
    max-width: 340px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.graph-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}

.graph-type-pill.active {
    background: color-mix(in srgb, var(--pill-color, #6B7280) 20%, transparent);
    color: var(--pill-color, rgba(255,255,255,0.8));
    border-color: color-mix(in srgb, var(--pill-color, #6B7280) 40%, transparent);
}

.graph-type-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.graph-type-count {
    opacity: 0.65;
    font-size: 10px;
}

/* Canvas area */
.graph-canvas-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.graph-legend {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(13, 27, 42, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    z-index: 10;
    pointer-events: auto;
    min-width: 130px;
    line-height: 1.3;
    user-select: none;
    -webkit-user-select: none;
}
.graph-legend-header {
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.graph-legend-title {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.35);
    margin-bottom: 5px;
}
.graph-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
}
.graph-legend-item:last-child { margin-bottom: 0; }
.graph-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.graph-legend-ring {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
    background: transparent;
}
.graph-legend-sep {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 6px 0 7px;
}

.graph-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: #1A1A2E;
    display: block;
}

.graph-svg .graph-link {
    stroke: rgba(255,255,255,0.2);
    stroke-width: 1.5;
}

.graph-svg .graph-link-label {
    font-size: 9px;
    fill: rgba(255,255,255,0.35);
    pointer-events: none;
    text-anchor: middle;
}

.graph-svg .graph-node circle {
    transition: stroke-width 150ms ease, stroke-opacity 150ms ease, filter 150ms ease;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
}

.graph-svg .graph-node.selected circle {
    filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

.graph-svg .graph-node text {
    pointer-events: none;
    user-select: none;
}

/* Stats badge */
.graph-stats-badge {
    position: absolute;
    bottom: 12px;
    left: 14px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* Side panel */
.graph-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    background: rgba(13, 27, 42, 0.97);
    border-left: 1px solid rgba(255,255,255,0.08);
    transform: translateX(100%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
}

.graph-panel.open {
    transform: translateX(0);
}

.graph-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.graph-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.graph-panel-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color 150ms ease;
    flex-shrink: 0;
}

.graph-panel-close:hover { color: rgba(255,255,255,0.8); }

.graph-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.graph-panel-body::-webkit-scrollbar { width: 4px; }
.graph-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.graph-panel-type-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.graph-panel-section {
    margin-bottom: 14px;
}

.graph-panel-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.35);
    margin-bottom: 8px;
}

.graph-panel-label-full {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    word-break: break-word;
    margin-bottom: 4px;
}

.graph-panel-date {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
}

.graph-panel-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.graph-panel-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.graph-panel-meta-key {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    text-transform: capitalize;
    flex-shrink: 0;
    max-width: 100px;
}

.graph-panel-meta-val {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    text-align: right;
    word-break: break-all;
}

.graph-panel-connections {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.graph-panel-conn-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.graph-panel-conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.graph-panel-conn-label {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.graph-panel-conn-rel {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    flex-shrink: 0;
    font-style: italic;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.graph-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,113,227,0.2);
    border: 1px solid rgba(0,113,227,0.4);
    border-radius: 8px;
    color: #60B0FF;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 8px 14px;
    cursor: pointer;
    width: 100%;
    transition: all 150ms ease;
}

.graph-btn-action:hover {
    background: rgba(0,113,227,0.35);
    border-color: rgba(0,113,227,0.6);
    color: white;
}

.graph-btn-action--ghost {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.5);
}

.graph-btn-action--ghost:hover {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.35);
    color: #FCA5A5;
}

/* Empty state */
.graph-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1A1A2E;
    z-index: 5;
}

.graph-empty-inner {
    text-align: center;
    padding: 40px;
}

.graph-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    margin: 16px 0 8px;
}

.graph-empty-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.3);
    margin-bottom: 24px;
    max-width: 320px;
}

/* Graph mini-preview card in Results */
.graph-mini-card {
    background: linear-gradient(135deg, #EEF6FF 0%, #F0F8FF 100%);
    border: 1px solid rgba(0,113,227,0.12);
    box-shadow: 0 2px 8px rgba(0,113,227,0.05);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.graph-mini-card:hover {
    box-shadow: 0 4px 16px rgba(0,113,227,0.15);
    transform: translateY(-1px);
}

.graph-mini-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

/* General modal primitives used by Add Searches and similar overlays */
.ct-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.ct-modal {
    background: #0D1B2A;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.45);
    width: 100%;
    padding: 0;
    animation: scaleIn 160ms ease;
}

.ct-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ct-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.ct-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    font-family: inherit;
    transition: color 150ms ease;
}

.ct-modal-close:hover {
    color: rgba(255,255,255,0.8);
    transform: none;
}

.ct-modal-body {
    padding: 12px 20px;
}

.ct-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.ct-btn-primary {
    background: var(--color-accent, #0071E3);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 8px 18px;
    cursor: pointer;
    transition: opacity 150ms ease;
}

.ct-btn-primary:hover { opacity: 0.85; }
.ct-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.ct-btn-secondary {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 8px 18px;
    cursor: pointer;
    transition: background 150ms ease;
}

.ct-btn-secondary:hover { background: rgba(255,255,255,0.12); }

/* ===== LOADING OVERLAY ===== */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #0D1B2A;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: loadingFadeIn 0.35s ease both;
}

@keyframes loadingFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.loading-svg-wrap {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-svg-mark {
    width: 80px;
    height: 80px;
    animation: loadingLogoSpin 2s linear infinite;
    transform-origin: center;
    filter: drop-shadow(0 0 16px rgba(43, 182, 177, 0.4));
}

@keyframes loadingLogoSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.loading-label {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.01em;
    margin: 0;
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.4s steps(4, end) infinite;
}

@keyframes loadingDots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

#loading-overlay.fade-out {
    animation: loadingFadeOut 0.4s ease forwards;
}

@keyframes loadingFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ===== SIDEBAR LOGO (ClearTrace mark) ===== */
.sidebar-logo.ct-logo-mark {
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

/* ===== HISTORY DELETE BUTTON ===== */
.history-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    color: var(--color-text-secondary);
    opacity: 0;
    transition: opacity 150ms ease, color 150ms ease, background 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

tr:hover .history-delete-btn {
    opacity: 1;
}

.history-delete-btn:hover {
    color: var(--color-danger);
    background: rgba(255,59,48,0.08);
}

/* ===== REPORTS SECTION ===== */
.reports-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--color-border);
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.reports-search-item:hover {
    border-color: var(--color-accent);
}

.reports-search-item input[type="checkbox"] {
    accent-color: var(--color-accent);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.reports-search-item-name {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
}

.reports-search-item-meta {
    font-size: 11px;
    color: var(--color-text-secondary);
}

.reports-result-card {
    background: #0D1B2A;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 14px 16px;
}

.reports-result-card h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.45);
    margin: 0 0 10px;
}

.reports-result-item {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    line-height: 1.5;
    text-align: justify;
    text-justify: inter-word;
}

.reports-result-item:last-child {
    border-bottom: none;
}

.reports-result-severity {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.reports-sev-high { background: rgba(255,59,48,0.18); color: #FF6B6B; }
.reports-sev-medium { background: rgba(255,149,0,0.18); color: #FF9500; }
.reports-sev-low { background: rgba(52,199,89,0.18); color: #34C759; }
.reports-sev-info { background: rgba(0,113,227,0.18); color: #5AC8FA; }

.reports-download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--color-accent);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 150ms ease;
}

.reports-download-link:hover { opacity: 0.85; }

.reports-download-link.excel {
    background: #1D6F42;
}

/* ===== REPORTS RESULT CARDS — COLLAPSIBLE + COLOR BORDERS ===== */
.reports-result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}
.reports-result-card-header h4 { margin: 0; }
.reports-collapse-icon {
    font-size: 14px;
    color: rgba(255,255,255,0.35);
    transition: transform 200ms ease;
    display: inline-block;
}
.reports-result-card.collapsed .reports-collapse-icon {
    transform: rotate(-90deg);
}
.reports-result-card.collapsed .reports-result-card-body {
    display: none;
}
.reports-result-card--discrepancy { border-left: 3px solid #F5A623; }
.reports-result-card--redflag     { border-left: 3px solid #FF3B30; }
.reports-result-card--entity      { border-left: 3px solid #7B61FF; }
.reports-result-card--correlation { border-left: 3px solid #5AC8FA; }

/* ===== ENTITY ACTION BUTTONS ===== */
.reports-entity-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 0;
}
.reports-entity-name {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.reports-entity-type {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.reports-entity-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.reports-entity-action-btn {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    transition: background 150ms, color 150ms;
}
.reports-entity-action-btn:hover {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.9);
}
.reports-entity-action-btn.primary {
    border-color: rgba(43,182,177,0.35);
    color: #48EFB7;
    background: rgba(43,182,177,0.08);
}
.reports-entity-action-btn.primary:hover {
    background: rgba(43,182,177,0.15);
}
.reports-entity-action-btn.analyze {
    border-color: rgba(0,113,227,0.35);
    color: #5AC8FA;
    background: rgba(0,113,227,0.08);
}
.reports-entity-action-btn.analyze:hover {
    background: rgba(0,113,227,0.15);
}
.reports-entity-badge-ingraph {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 6px;
    cursor: default;
    user-select: none;
}
.reports-entity-badge-ingraph::before {
    content: '✓';
    font-size: 10px;
    color: #34C759;
}

/* ===== GENERATE PROGRESS BAR ===== */
.reports-gen-progress-wrap {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}
.reports-gen-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2BB6B1, #48EFB7);
    border-radius: 3px;
    width: 0%;
    transition: width 0.6s ease;
}
.reports-gen-progress-fill.indeterminate {
    width: 60%;
    animation: genProgressPulse 1.6s ease-in-out infinite;
}
@keyframes genProgressPulse {
    0%, 100% { margin-left: 0%; width: 60%; }
    50%       { margin-left: 40%; width: 40%; }
}

/* ── Search analysis progress bar ─────────────────────────────────────── */
.search-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0,113,227,0.15);
    border-radius: 4px;
    overflow: hidden;
    transition: opacity 0.4s ease;
}
.search-progress-bar.fading { opacity: 0; }
.search-progress-fill {
    height: 100%;
    width: 0%;
    background: #0071E3;
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

/* ── DR progress bar ───────────────────────────────────────────────────── */
.reports-dr-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0,113,227,0.15);
    border-radius: 4px;
    overflow: hidden;
    transition: opacity 0.4s ease;
}
.reports-dr-progress-bar.fading {
    opacity: 0;
}
.reports-dr-progress-fill {
    height: 100%;
    width: 0%;
    background: #0071E3;
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

/* ── Feed collapsible ───────────────────────────────────────────────────── */
.reports-feed-chevron {
    color: rgba(255,255,255,0.4);
    font-size: 14px;
    transition: transform 200ms ease;
    line-height: 1;
}
.reports-feed-collapsed .reports-feed-chevron {
    transform: rotate(-90deg);
}
.reports-feed-collapsed .activity-feed-body {
    display: none !important;
}
.reports-feed-collapsed .activity-feed-footer {
    display: none !important;
}

/* ── Report ready banner ────────────────────────────────────────────────── */
.reports-ready-banner {
    background: rgba(52,199,89,0.08);
    border: 1px solid rgba(52,199,89,0.25);
    border-radius: var(--radius-card);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.reports-ready-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    background: rgba(52,199,89,0.12);
    color: #34C759;
    border: 1px solid rgba(52,199,89,0.25);
    transition: background 150ms ease;
}
.reports-ready-link:hover { background: rgba(52,199,89,0.22); }
.reports-ready-link.excel { background: rgba(76,175,80,0.12); color: #4CAF50; border-color: rgba(76,175,80,0.25); }
.reports-ready-link.excel:hover { background: rgba(76,175,80,0.22); }

/* ── Graph node flash (duplicate highlight) ─────────────────────────────── */
@keyframes nodeFlash {
    0%, 100% { filter: drop-shadow(0 0 0px transparent); stroke: inherit; stroke-width: inherit; }
    20%, 60% { filter: drop-shadow(0 0 14px #FF9F0A) drop-shadow(0 0 4px rgba(0,0,0,0.6)); stroke: #FF9F0A; stroke-width: 3; stroke-opacity: 1; }
    40%, 80% { filter: drop-shadow(0 0 6px #FF9F0A); stroke: #FF9F0A; stroke-width: 2; stroke-opacity: 0.8; }
}
.graph-node circle.graph-node-flash {
    animation: nodeFlash 0.5s ease-in-out 4;
}

/* ── Graph merge target glow ────────────────────────────────────────────── */
@keyframes mergeGlow {
    0%, 100% { filter: drop-shadow(0 0 8px #0071E3) drop-shadow(0 0 2px rgba(0,0,0,0.5)); }
    50%       { filter: drop-shadow(0 0 16px #48EFB7) drop-shadow(0 0 4px rgba(0,0,0,0.5)); }
}
.graph-node circle.merge-target {
    animation: mergeGlow 0.8s ease-in-out infinite;
    stroke: #48EFB7 !important;
    stroke-width: 3 !important;
    stroke-opacity: 1 !important;
}

/* ── Graph link-target glow (different types, create edge) ──────────────── */
.graph-node circle.link-target {
    animation: linkGlow 0.8s ease-in-out infinite;
    stroke: #F59E0B !important;
    stroke-width: 3 !important;
    stroke-opacity: 1 !important;
    stroke-dasharray: 6 3;
}
@keyframes linkGlow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(245,158,11,0.5)); }
    50% { filter: drop-shadow(0 0 10px rgba(245,158,11,0.9)); }
}

/* ── Graph merge tooltip ────────────────────────────────────────────────── */
.graph-merge-tip {
    position: fixed;
    z-index: 9999;
    background: rgba(13,27,42,0.95);
    border: 1px solid rgba(72,239,183,0.4);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: #48EFB7;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    pointer-events: none;
}

/* ── Graph link tooltip (cross-type) ────────────────────────────────────── */
.graph-link-tip {
    position: fixed;
    z-index: 9999;
    background: rgba(13,27,42,0.95);
    border: 1px solid rgba(245,158,11,0.5);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: #F59E0B;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    pointer-events: none;
}

/* ── Sidebar tutorial button ────────────────────────────────────────────── */
.tutorial-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-secondary);
    line-height: 1;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.tutorial-btn:hover {
    background: rgba(0,113,227,0.08);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ── Skipped checks toggle ──────────────────────────────────────────────── */
.check-skipped-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-top: 1px solid var(--color-border);
    user-select: none;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.check-skipped-toggle:hover {
    background: rgba(0,0,0,0.03);
    color: var(--color-text);
}
.check-skipped-chevron {
    font-size: 10px;
    transition: transform 200ms ease;
    display: inline-block;
}
.check-skipped-body {
    border-top: 1px solid var(--color-border);
}

/* ── Tutorial overlay fade-in ──────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── History tabs ────────────────────────────────────────────────────────── */
.history-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0;
}
.history-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    border-radius: 0;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.history-tab:hover {
    color: var(--color-text);
}
.history-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}

/* ── Report history action btns ─────────────────────────────────────────── */
.rh-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
}
.rh-btn-view {
    background: rgba(0,113,227,0.1);
    color: var(--color-accent);
    border-color: rgba(0,113,227,0.2);
}
.rh-btn-view:hover {
    background: rgba(0,113,227,0.18);
}
.rh-btn-dl {
    background: rgba(43,182,177,0.08);
    color: #2BB6B1;
    border-color: rgba(43,182,177,0.2);
}
.rh-btn-dl:hover {
    background: rgba(43,182,177,0.15);
}
.rh-fmt-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.rh-fmt-html { background: rgba(43,182,177,0.12); color: #2BB6B1; }
.rh-fmt-pdf  { background: rgba(212,46,46,0.12); color: #D42E2E; }
.rh-fmt-excel { background: rgba(45,168,90,0.12); color: #2DA85A; }

/* ── History grouped versioning ──────────────────────────────────────────── */
.rh-group-row {
    background: rgba(255,255,255,0.025);
    cursor: pointer;
    user-select: none;
}
.rh-group-row:hover {
    background: rgba(255,255,255,0.045);
}
.rh-group-chevron {
    color: rgba(255,255,255,0.45);
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.rh-ver-count {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1px 8px;
}
.rh-ver-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,113,227,0.14);
    color: #4DA6FF;
    border: 1px solid rgba(0,113,227,0.25);
}
.rh-version-row td {
    border-left: 2px solid rgba(255,255,255,0.04);
}
.rh-act-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.rh-act-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rh-btn-del {
    background: transparent;
    color: rgba(255,255,255,0.2);
    border-color: transparent;
    opacity: 0;
    transition: opacity 150ms ease, color 150ms ease, background 150ms ease;
}
.rh-version-row:hover .rh-btn-del {
    opacity: 1;
    color: rgba(212,46,46,0.7);
}
.rh-btn-del:hover {
    background: rgba(212,46,46,0.12) !important;
    color: #D42E2E !important;
    border-color: rgba(212,46,46,0.3) !important;
}
.rh-del-wrap {
    margin-left: auto;
}

/* ── Report lightbox ─────────────────────────────────────────────────────── */
.report-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    animation: fadeIn 200ms ease;
    cursor: default;
}
.report-lightbox-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    max-height: calc(100vh - 64px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    cursor: default;
}
.report-lightbox-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #0D1B2A;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    gap: 12px;
}
.report-lightbox-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.report-lightbox-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.report-lightbox-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.12);
    cursor: pointer;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.75);
    transition: background var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
}
.report-lightbox-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.report-lightbox-btn-primary {
    background: rgba(0,113,227,0.18);
    color: #4DA6FF;
    border-color: rgba(0,113,227,0.3);
}
.report-lightbox-btn-primary:hover {
    background: rgba(0,113,227,0.28);
    color: #fff;
}
.report-lightbox-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}
.report-lightbox-close:hover {
    background: rgba(255,60,60,0.2);
    color: #fff;
    border-color: rgba(255,60,60,0.35);
}
.report-lightbox-iframe,
embed.report-lightbox-iframe,
object.report-lightbox-iframe {
    flex: 1;
    border: none;
    width: 100%;
    background: #0D1B2A;
    min-height: 0;
    display: block;
}

/* ── Version History Picker ─────────────────────────────────── */
.rver-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    transition: background 0.15s;
}
.rver-row:hover { background: rgba(255,255,255,0.05); }
.rver-row-selected { background: rgba(43,182,177,0.1); }
.rver-badge {
    font-size: 11px;
    font-weight: 700;
    color: #2BB6B1;
    background: rgba(43,182,177,0.15);
    border-radius: 4px;
    padding: 1px 6px;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.rver-date {
    color: rgba(255,255,255,0.55);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rver-meta {
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
    flex-shrink: 0;
}
.rver-sel-label {
    color: rgba(43,182,177,0.8);
    font-size: 11px;
    flex-shrink: 0;
}
.rver-select-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.7);
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.rver-select-btn:hover {
    background: rgba(43,182,177,0.2);
    color: #fff;
    border-color: rgba(43,182,177,0.5);
}
.rver-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 3px;
    padding: 1px 5px;
    flex-shrink: 0;
}
.rver-status-ok  { color: #2BB6B1; background: rgba(43,182,177,0.12); }
.rver-status-run { color: #F5A623; background: rgba(245,166,35,0.12); }
.rver-status-err { color: #E05252; background: rgba(224,82,82,0.12); }

/* ===== CHAT WIDGET ===== */
#chat-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #0071E3;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,113,227,0.45);
    z-index: 1200;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
#chat-fab:hover {
    background: #0077ED;
    transform: scale(1.07);
    box-shadow: 0 6px 20px rgba(0,113,227,0.55);
}
#chat-fab svg { pointer-events: none; }

#chat-panel {
    position: fixed;
    bottom: 88px;
    right: 28px;
    width: 400px;
    height: 450px;
    background: #1C1C2E;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,0.55);
    z-index: 1199;
    overflow: hidden;
    animation: chatSlideIn 0.2s ease;
}
@keyframes chatSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
#chat-panel.chat-open { display: flex; }

.chat-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px 10px;
    background: #111122;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.chat-header-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-header-row2 {
    display: flex;
}
.chat-header-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.chat-inv-select {
    font-size: 11px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.75);
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    width: 100%;
}
.chat-inv-select option { background: #1C1C2E; }
.chat-header-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.chat-header-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }

@keyframes chatLogoSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes chatLogoPulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}
.chat-spinner-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chat-spinner-logo svg {
    animation: chatLogoSpin 2s linear infinite, chatLogoPulse 2s ease-in-out infinite;
    transform-origin: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.chat-bubble {
    max-width: 88%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.chat-bubble.user {
    background: #0071E3;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-bubble.ai {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.88);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    text-align: justify;
    text-justify: inter-word;
}
.chat-bubble.ai.typing { color: rgba(255,255,255,0.45); font-style: italic; }
.chat-bubble.ai .chat-cursor {
    display: inline-block;
    width: 2px;
    height: 13px;
    background: rgba(255,255,255,0.6);
    margin-left: 2px;
    vertical-align: middle;
    animation: chatBlink 0.6s step-start infinite;
}
@keyframes chatBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.chat-footer {
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}
#chat-input {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    padding: 8px 11px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.45;
    max-height: 90px;
    overflow-y: auto;
    transition: border-color 0.15s;
}
#chat-input::placeholder { color: rgba(255,255,255,0.28); }
#chat-input:focus { border-color: rgba(0,113,227,0.6); }
#chat-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #0071E3;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, opacity 0.15s;
}
#chat-send-btn:hover { background: #0077ED; }
#chat-send-btn:disabled { opacity: 0.45; cursor: default; }
