/* ======================================
   Researchus - Dark shadcn-inspired theme
   ====================================== */

/* Reset & base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root,
[data-theme="dark"] {
    --bg-base: #0c0e1a;
    --bg-sidebar: #0f1120;
    --bg-panel: #121428;
    --bg-card: #171934;
    --bg-input: #1a1d3a;
    --bg-hover: #1e2148;
    --bg-active: #232750;
    --border: #252a4a;
    --border-light: #2d3260;
    --text-primary: #e2e4ed;
    --text-secondary: #8b8fa8;
    --text-muted: #5c6080;
    --accent: #4fd1c5;
    --accent-hover: #38b2ac;
    --accent-dim: rgba(79, 209, 197, 0.15);
    --danger: #f56565;
    --success: #48bb78;
    --info: #4299e1;
    --radius: 8px;
    --radius-sm: 4px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --log-bg: #080a14;
    --log-border: rgba(37, 42, 74, 0.4);
}

[data-theme="light"] {
    --bg-base: #f8f9fb;
    --bg-sidebar: #ffffff;
    --bg-panel: #ffffff;
    --bg-card: #f1f3f7;
    --bg-input: #f1f3f7;
    --bg-hover: #e8ebf0;
    --bg-active: #dfe3ea;
    --border: #d8dce5;
    --border-light: #c8cdd8;
    --text-primary: #1a1d2e;
    --text-secondary: #4a5068;
    --text-muted: #8b90a5;
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-dim: rgba(13, 148, 136, 0.1);
    --danger: #dc2626;
    --success: #16a34a;
    --info: #2563eb;
    --log-bg: #f1f3f7;
    --log-border: rgba(0, 0, 0, 0.06);
}

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* ======================================
   Layout: sidebar + main
   ====================================== */

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

/* Icon sidebar */
.icon-sidebar {
    width: 52px;
    min-width: 52px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.sidebar-top, .sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #b4a0d8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
}

.sidebar-logo i {
    font-size: 16px;
    color: white;
}

.sidebar-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    transition: all 0.15s ease;
}

.sidebar-icon:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-icon.active {
    color: var(--accent);
    background: var(--accent-dim);
}

/* Main area */
.main-area {
    flex: 1;
    overflow: hidden;
}

/* ======================================
   Two-panel layout (list + detail)
   ====================================== */

.two-panel {
    display: flex;
    height: 100vh;
}

.list-panel {
    width: 380px;
    min-width: 380px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-panel {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-base);
    padding: 0;
}

/* Panel header */
.panel-title {
    font-size: 16px;
    font-weight: 600;
    padding: 18px 20px 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.panel-subtitle {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 14px 20px 8px;
}

/* Insight search */
.insight-search-wrap {
    position: relative;
    padding: 6px 20px 8px;
}

.insight-search-icon {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
}

.insight-search {
    width: 100%;
    padding: 7px 10px 7px 28px;
    font-size: 13px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s ease;
}

.insight-search::placeholder {
    color: var(--text-muted);
}

.insight-search:focus {
    border-color: var(--accent);
}

/* Stats */
.stats-row {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
}

.stat-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 6px;
    text-align: center;
}

.stat-number {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.section-divider {
    height: 1px;
    background: var(--border);
    margin: 0 20px;
}

/* Item list */
.item-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.list-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
}

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

.list-item.active {
    background: var(--bg-active);
    border-left: 3px solid var(--accent);
    padding-left: 17px;
}

.list-item-title {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.list-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.copy-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: #00b303;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    opacity: 0;
}

.list-item:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: rgba(0, 179, 3, 0.15);
    color: #33c236;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-postgres {
    background: rgba(66, 153, 225, 0.15);
    color: var(--info);
}

.badge-vector {
    background: rgba(79, 209, 197, 0.15);
    color: var(--accent);
}

.badge-db {
    background: rgba(66, 153, 225, 0.15);
    color: var(--info);
}

.badge-fluint {
    background: rgba(237, 137, 54, 0.15);
    color: #ed8936;
}

.badge-feedback {
    background: rgba(159, 122, 234, 0.15);
    color: #9f7aea;
}

.badge-both {
    background: rgba(246, 173, 85, 0.15);
    color: #f6ad55;
}

/* Detail panel content */
.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.detail-placeholder i {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.detail-placeholder p {
    max-width: 300px;
    line-height: 1.6;
}

.detail-content {
    padding: 28px 32px;
}

.detail-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.detail-meta-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.copy-btn-visible {
    opacity: 1;
}

/* Delete button */
.delete-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    opacity: 0;
}

.list-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: rgba(245, 101, 101, 0.15);
    color: var(--danger);
}

.delete-btn-visible {
    opacity: 1;
}

/* Visibility toggle button */
.visibility-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 1;
}

.visibility-btn:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

.visibility-btn.is-public {
    color: var(--accent);
}

.visibility-btn.is-public:hover {
    background: rgba(245, 101, 101, 0.15);
    color: var(--danger);
}

/* Visibility tooltip (appended to body) */
.visibility-tooltip {
    position: fixed;
    width: 260px;
    padding: 10px 14px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    border-radius: var(--radius);
    border: 1px solid #2a2a4a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    white-space: normal;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 10000;
}

.visibility-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Markdown body */
.markdown-body {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 10px;
}

.markdown-body h1 { font-size: 20px; }
.markdown-body h2 { font-size: 17px; }
.markdown-body h3 { font-size: 15px; }

.markdown-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 20px;
    margin: 8px 0;
}

.markdown-body li {
    margin-bottom: 4px;
}

.markdown-body p {
    margin-bottom: 12px;
}

/* ======================================
   Form elements
   ====================================== */

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

.form-group:first-child {
    margin-top: 16px;
}

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

.form-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

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

.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-muted);
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.radio-label input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
}

.radio-label input[type="radio"]:checked {
    border-color: var(--accent);
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 3px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
    border-color: var(--accent);
    background: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%) rotate(45deg);
}

/* Form scroll area */
.form-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 16px;
}

/* Planhat filters */
.planhat-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    transition: background 0.15s;
}

.planhat-filters-header:hover {
    background: var(--bg-hover);
}

.planhat-filters-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.planhat-filters-header .form-label {
    margin-bottom: 0;
    cursor: pointer;
}

.planhat-section-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.planhat-section-chevron.open {
    transform: rotate(90deg);
}

.planhat-filters-body {
    margin-top: 8px;
}

.planhat-clear-all {
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
}

.planhat-clear-all:hover {
    color: var(--danger);
}

.planhat-filters-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.planhat-filters-loading {
    color: var(--text-muted);
    font-size: 12px;
    padding: 8px 0;
}

.planhat-filter {
    position: relative;
}

.planhat-filter-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: border-color 0.15s ease;
    user-select: none;
}

.planhat-filter-trigger:hover {
    border-color: var(--border-light);
}

.planhat-filter-trigger.has-selection {
    border-color: var(--accent);
    color: var(--text-primary);
}

.planhat-filter-label {
    flex: 1;
}

.planhat-filter-count {
    background: var(--accent);
    color: var(--bg-base);
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    padding: 0 5px;
    border-radius: 10px;
}

.planhat-filter-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.planhat-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 240px;
    display: flex;
    flex-direction: column;
}

.planhat-filter-search {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}

.planhat-filter-search input {
    width: 100%;
    padding: 6px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 12px;
    outline: none;
}

.planhat-filter-search input:focus {
    border-color: var(--accent);
}

.planhat-filter-search input::placeholder {
    color: var(--text-muted);
}

.planhat-filter-options {
    overflow-y: auto;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.planhat-filter-options .checkbox-label {
    font-size: 12px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
}

.planhat-filter-options .checkbox-label:hover {
    background: var(--bg-hover);
}

/* Planhat range filters */
.planhat-range-filter {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    transition: border-color 0.15s ease;
}

.planhat-range-filter.has-selection {
    border-color: var(--accent);
}

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

.planhat-range-header .planhat-filter-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.planhat-range-hint {
    font-size: 10px;
    color: var(--text-muted);
}

.planhat-range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.planhat-range-field {
    flex: 1;
}

.planhat-range-input-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
    display: block;
}

.planhat-range-input {
    width: 100%;
    padding: 5px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    outline: none;
}

.planhat-range-input:focus {
    border-color: var(--accent);
}

.planhat-range-input::placeholder {
    color: var(--text-muted);
}

.planhat-range-input::-webkit-inner-spin-button {
    opacity: 0.3;
}

.planhat-range-sep {
    color: var(--text-muted);
    font-size: 12px;
    padding-top: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0 20px;
}

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

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ======================================
   Loading & status states
   ====================================== */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    color: var(--text-muted);
    text-align: center;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.error-banner {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    border-radius: var(--radius);
    padding: 14px 18px;
    color: var(--danger);
    margin: 24px 32px;
}

.error-banner i {
    margin-right: 8px;
}

.status-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
}

.status-message.info {
    background: rgba(66, 153, 225, 0.1);
    border: 1px solid rgba(66, 153, 225, 0.3);
    color: var(--info);
}

.status-message.success {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid rgba(72, 187, 120, 0.3);
    color: var(--success);
}

.status-message.error {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    color: var(--danger);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    line-height: 1.6;
}

/* ======================================
   Single panel layout (health, etc.)
   ====================================== */

.single-panel {
    height: 100vh;
    overflow-y: auto;
    padding: 0 32px 32px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.page-header .panel-title {
    padding: 0;
    border-bottom: none;
}

/* Small button variant */
.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
    margin: 0;
}

/* Secondary button */
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ======================================
   Health check page
   ====================================== */

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.health-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: border-color 0.15s ease;
}

.health-card.loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
    grid-column: 1 / -1;
}

.health-card-ok {
    border-left: 3px solid var(--success);
}

.health-card-fail {
    border-left: 3px solid var(--danger);
}

.health-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.health-card-icon {
    font-size: 16px;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

.health-card-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.health-ok {
    color: var(--success);
}

.health-fail {
    color: var(--danger);
}

.health-card-detail {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 30px;
    word-break: break-all;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
    margin-bottom: 0;
}

/* ======================================
   Import page
   ====================================== */

.import-summary {
    display: flex;
    gap: 8px;
    padding: 20px;
}

.import-counter {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
}

.import-counter-ok {
    border-top: 2px solid var(--success);
}

.import-counter-skip {
    border-top: 2px solid var(--info);
}

.import-counter-fail {
    border-top: 2px solid var(--danger);
}

.import-counter-number {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.import-counter-ok .import-counter-number { color: var(--success); }
.import-counter-skip .import-counter-number { color: var(--info); }
.import-counter-fail .import-counter-number { color: var(--danger); }

.import-counter-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-top: 2px;
}

.import-progress {
    padding: 0 20px 16px;
}

.import-progress-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}

.import-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.import-progress-text {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.import-section {
    padding-bottom: 16px;
}

.import-section-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 14px 20px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-section-header i {
    color: var(--accent);
    font-size: 14px;
}

.import-section-desc {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 20px 12px;
    line-height: 1.5;
}

.import-section-divider {
    height: 1px;
    background: var(--border);
    margin: 0 20px;
}

.import-validation {
    padding: 0 20px 8px;
}

.validation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}

.validation-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 11px;
}

.validation-label {
    color: var(--text-muted);
}

.validation-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.validation-ok {
    color: var(--success);
}

.validation-warn {
    color: var(--warning, #ecc94b);
}

.log-phase {
    padding: 10px 0 4px;
    border-bottom: none;
}

.log-phase-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 4px;
}

/* ======================================
   Log output (terminal style)
   ====================================== */

.log-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.log-placeholder i {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.log-placeholder p {
    max-width: 300px;
    line-height: 1.6;
}

.log-output {
    height: 100%;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", "Consolas", monospace;
    font-size: 12px;
    line-height: 1.7;
    background: var(--log-bg);
}

.log-line {
    padding: 3px 0;
    border-bottom: 1px solid var(--log-border);
}

.log-ts {
    color: var(--text-muted);
    margin-right: 8px;
    font-size: 11px;
}

.log-icon {
    margin-right: 6px;
}

.log-index {
    color: var(--text-muted);
    margin-right: 6px;
}

.log-muted {
    color: var(--text-muted);
    font-style: italic;
}

.log-warn {
    color: #ecc94b;
}

/* Log badges */
.log-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-right: 6px;
}

.log-badge-ok {
    background: rgba(72, 187, 120, 0.15);
    color: var(--success);
}

.log-badge-skip {
    background: rgba(66, 153, 225, 0.15);
    color: var(--info);
}

.log-badge-fail {
    background: rgba(245, 101, 101, 0.15);
    color: var(--danger);
}

/* Log line types */
.log-info {
    color: var(--text-secondary);
}

.log-info .log-icon {
    color: var(--info);
}

.log-imported {
    color: var(--text-secondary);
}

.log-skipped {
    color: var(--text-muted);
}

.log-failed {
    color: var(--danger);
}

.log-error-line {
    color: var(--danger);
}

.log-error-line .log-icon {
    color: var(--danger);
}

.log-complete {
    color: var(--success);
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
}

.log-complete .log-icon {
    color: var(--success);
}

.log-error-detail {
    margin: 4px 0 4px 24px;
    padding: 8px 12px;
    background: rgba(245, 101, 101, 0.08);
    border: 1px solid rgba(245, 101, 101, 0.2);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* ======================================
   Theme toggle
   ====================================== */

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ======================================
   Scrollbar
   ====================================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ======================================
   Auth pages (login, setup)
   ====================================== */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-base);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
}

.auth-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #b4a0d8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-logo i {
    font-size: 22px;
    color: white;
}

/* Large brain logo for login page */
.auth-logo-large {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-brain-svg {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    filter: drop-shadow(0 0 20px rgba(180, 160, 216, 0.35))
           drop-shadow(0 0 40px rgba(180, 160, 216, 0.15));
    animation: brain-breathe 4s ease-in-out infinite;
}

@keyframes brain-breathe {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(180, 160, 216, 0.35))
               drop-shadow(0 0 40px rgba(180, 160, 216, 0.15));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 28px rgba(180, 160, 216, 0.5))
               drop-shadow(0 0 56px rgba(180, 160, 216, 0.25));
        transform: scale(1.03);
    }
}

.auth-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-subtitle strong {
    color: var(--accent);
}

.auth-error {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

.auth-error i {
    margin-right: 6px;
}

.auth-field {
    margin-bottom: 16px;
    text-align: left;
}

.auth-btn {
    width: 100%;
    margin: 8px 0 0 0;
    padding: 12px;
}

/* ======================================
   Settings page
   ====================================== */

.settings-section {
    margin-bottom: 8px;
}

.settings-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.settings-section-title i {
    color: var(--accent);
    margin-right: 8px;
    width: 18px;
    text-align: center;
}

.settings-section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* User list items */
.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.user-inactive {
    opacity: 0.5;
}

.badge-role-admin {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-role-member {
    background: rgba(66, 153, 225, 0.15);
    color: var(--info);
}

.badge-pending {
    background: rgba(139, 143, 168, 0.15);
    color: var(--text-muted);
}

.badge-inactive {
    background: rgba(245, 101, 101, 0.15);
    color: var(--danger);
}

/* Invite link */
.invite-link-box {
    margin-top: 8px;
}

.invite-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.invite-link-row .form-input {
    flex: 1;
    font-size: 12px;
}

/* Sidebar user */
.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

.sidebar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ======================================
   Dashboard animated brain SVG
   ====================================== */

.brain-anim-svg {
    width: 440px;
    height: 320px;
    margin-bottom: 20px;
}

/* Floating documents */
.floating-doc.doc-left {
    animation: float-left 5s ease-in-out infinite;
}

.floating-doc.doc-right {
    animation: float-right 5.5s ease-in-out infinite;
}

@keyframes float-left {
    0%, 100% { transform: translate(28px, 70px); }
    50% { transform: translate(28px, 62px); }
}

@keyframes float-right {
    0%, 100% { transform: translate(220px, 60px); }
    50% { transform: translate(220px, 52px); }
}

/* Scan line sweeping down the documents */
.scan-line-1 {
    animation: scan-doc 3s ease-in-out infinite;
}

.scan-line-2 {
    animation: scan-doc 3s ease-in-out infinite 1.5s;
}

@keyframes scan-doc {
    0% { y: 8; opacity: 0; }
    10% { opacity: 0.6; }
    80% { opacity: 0.6; }
    90% { y: 32; opacity: 0; }
    100% { y: 32; opacity: 0; }
}

/* Brain glow pulse */
.brain-glow {
    animation: glow-pulse 4s ease-in-out infinite;
}

.brain-glow-outer {
    animation: glow-pulse 4s ease-in-out infinite 1s;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.1; r: 48; }
    50% { opacity: 0.25; r: 52; }
}

/* Neural dots glow */
.neural-dot {
    filter: drop-shadow(0 0 4px rgba(79, 209, 197, 0.6));
}

/* Connection line dash animation */
.connection-line {
    animation: dash-flow 2s linear infinite;
}

@keyframes dash-flow {
    to { stroke-dashoffset: -14; }
}

/* Brain half subtle pulse */
.brain-half {
    animation: brain-stroke-pulse 4s ease-in-out infinite;
}

.brain-right {
    animation-delay: 0.5s;
}

@keyframes brain-stroke-pulse {
    0%, 100% { stroke: #b4a0d8; stroke-width: 1.8; }
    50% { stroke: #c9b8e8; stroke-width: 2.1; }
}

.brain-detail {
    animation: detail-fade 4s ease-in-out infinite;
}

@keyframes detail-fade {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.6; }
}

/* How-to guide on dashboard placeholder */
.how-to-guide {
    margin-top: 24px;
    text-align: center;
    max-width: 520px;
}

.how-to-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-align: center;
}

.how-to-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0;
}

.how-to-steps li {
    counter-increment: step;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 6px 0;
}

.how-to-steps li::before {
    content: counter(step) ".";
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
}

.how-to-steps a {
    color: var(--accent);
}

/* ======================================
   Insight stats & batch sections
   ====================================== */

.insight-stats {
    display: flex;
    gap: 16px;
    padding: 14px 16px;
    margin: 16px 0;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
}

.batch-section {
    margin: 16px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.batch-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.batch-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.batch-content {
    padding: 16px;
}

.batch-content .loading-state {
    padding: 24px 0;
}

/* Hide back button on desktop */
.mobile-back-btn {
    display: none;
}

/* ======================================
   Companies table page
   ====================================== */

.companies-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-base);
}

.companies-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
    flex-shrink: 0;
}

.companies-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.companies-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.companies-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 3px 10px;
    border-radius: 12px;
}

.companies-search-wrap {
    position: relative;
}

.companies-search-wrap i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
}

.companies-search {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 7px 12px 7px 30px;
    font-size: 13px;
    width: 280px;
    outline: none;
}

.companies-search:focus {
    border-color: var(--accent);
}

.companies-table-wrap {
    flex: 1;
    overflow: auto;
}

.companies-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}

.companies-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.companies-table th {
    background: var(--bg-panel);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    cursor: pointer;
    user-select: none;
}

.companies-table th:hover {
    color: var(--text-primary);
}

.companies-table th i {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.5;
}

.companies-table th:hover i,
.companies-table th i.fa-sort-up,
.companies-table th i.fa-sort-down {
    opacity: 1;
    color: var(--accent);
}

.companies-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.companies-table tbody tr:hover {
    background: var(--bg-hover);
}

.col-sticky {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--bg-base);
}

.companies-table thead .col-sticky {
    background: var(--bg-panel);
    z-index: 3;
}

.companies-table tbody tr:hover .col-sticky {
    background: var(--bg-hover);
}

.col-name {
    min-width: 200px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.col-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.company-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

.company-link {
    color: var(--accent);
    text-decoration: none;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

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

.badge-status {
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.companies-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.companies-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-panel);
    flex-shrink: 0;
}

.btn-page {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
}

.btn-page:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-page:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ======================================
   Mobile responsive (< 768px)
   ====================================== */

@media (max-width: 768px) {
    /* Sidebar → bottom tab bar */
    .app-layout {
        flex-direction: column;
    }

    .icon-sidebar {
        order: 2;
        width: 100%;
        min-width: 0;
        height: 56px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 0 8px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: var(--bg-sidebar);
    }

    .sidebar-top, .sidebar-bottom {
        flex-direction: row;
        gap: 2px;
    }

    .sidebar-logo {
        margin-bottom: 0;
        margin-right: 4px;
    }

    .sidebar-user {
        padding: 0;
    }

    /* Main area fills screen above bottom bar */
    .main-area {
        order: 1;
        flex: 1;
        overflow: auto;
        padding-bottom: 56px;
    }

    /* Two-panel → single panel with slide */
    .two-panel {
        position: relative;
        overflow: hidden;
        height: calc(100vh - 56px);
    }

    .list-panel {
        width: 100%;
        min-width: 0;
    }

    .detail-panel {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        z-index: 10;
    }

    .two-panel.detail-active .detail-panel {
        transform: translateX(0);
    }

    /* Back button (visible only on mobile) */
    .mobile-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        color: var(--accent);
        font-family: var(--font);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        padding: 0;
        margin-bottom: 12px;
    }

    .mobile-back-btn:hover {
        color: var(--accent-hover);
    }

    /* Buttons always visible on touch (no hover) */
    .copy-btn,
    .delete-btn {
        opacity: 1;
    }

    /* Reduce detail padding */
    .detail-content {
        padding: 20px 16px;
    }

    .detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Constrain brain SVG */
    .brain-anim-svg {
        max-width: 100%;
        height: auto;
    }

    /* Single panel pages */
    .single-panel {
        padding: 0 16px 16px;
    }

    /* Detail placeholder padding */
    .detail-placeholder {
        padding: 24px;
    }

    /* Stats row on small screens */
    .stats-row {
        padding: 8px 12px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 40%;
    }

    .stat-number {
        font-size: 16px;
    }

    /* Markdown body overflow */
    .markdown-body {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Help page mobile */
    .help-page {
        padding: 0 16px 16px;
    }

    .help-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .help-subsections {
        grid-template-columns: 1fr;
    }
}


/* ───── Help Page ───── */

.help-page {
    height: 100vh;
    overflow-y: auto;
    padding: 0 32px 32px;
}

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-top: 32px;
}

.help-header .panel-title {
    margin: 0;
}

.help-copy-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.help-copy-all-btn:hover {
    background: var(--accent);
    color: var(--bg-base);
    border-color: var(--accent);
}

.help-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.help-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}

.help-section-icon {
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 8px;
}

.help-section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-badge-admin {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(79, 209, 197, 0.15);
    color: var(--accent);
}

.help-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0 0 10px;
}

.help-text:last-child {
    margin-bottom: 0;
}

.help-subsections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 16px;
}

.help-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.help-card h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-card h4 i {
    color: var(--accent);
    font-size: 12px;
    width: 14px;
    text-align: center;
}

.help-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 8px;
}

.help-card p:last-child {
    margin-bottom: 0;
}

.help-examples {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.help-examples li {
    font-size: 12.5px;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 0 4px 14px;
    position: relative;
}

.help-examples li::before {
    content: "\201C";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-style: normal;
}

.help-service-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
}

.help-service-list li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 5px 0 5px 18px;
    position: relative;
    line-height: 1.5;
}

.help-service-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* Help page how-to-guide overrides */
.help-section .how-to-guide {
    margin-top: 0;
    text-align: left;
}

.help-section .how-to-steps {
    padding-left: 0;
}

.help-section .how-to-steps li {
    text-align: left;
    justify-content: flex-start;
}
