/* Modern Minimalist Content Generation Tool Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #163E47;
    --primary-hover: #ff5a3d;
    --primary-light: rgba(255,90,61,0.08);
    --secondary: #0F172A;
    --secondary-hover: #020617;
    --accent: #ff5a3d;
    --accent-light: rgba(255,90,61,0.08);
    --success: #016B61;
    --success-light: #ECFDF5;
    --warning: #F59E0B;
    --info: #3B82F6;
    --background: #F4F4F4;
    --surface: #FFFFFF;
    --surface-elevated: #FFFFFF;
    --border: #E2E8F0;
    --border-light: rgba(22,62,71,0.25);
    --text-primary: #000814;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 0px;
    --radius-lg: 0px;
    --radius-xl: 0px;
}

body {
    font-family: 'Funnel Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* App Layout - Sidebar + Main Content */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background: #163E47;
    border-right: 1px solid rgba(205,216,218,0.3);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: none;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(205,216,218,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    height: 22px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border: none;
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover {
    background: rgba(255,90,61,0.15);
    color: #ff5a3d;
}

.nav-item.active {
    background: #ff5a3d;
    color: #fff;
    font-weight: 600;
}

.nav-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    background-color: #FF5A3D;
    border-radius: 5px;
}

.nav-icon svg {
    fill: #F4F4F4;
    width: 20px;
    height: 20px;
}

.nav-label {
    flex: 1;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(205,216,218,0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 2px;
}

.sidebar-user-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-logout-btn:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.08);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.view-container {
    padding: 2rem;
    min-height: calc(100vh - 64px);
    width: 100%;
}

.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.articles-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.article-card {
    background: var(--surface);
    border: 1px solid #CDD8DA;
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.article-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #CDD8DA;
    transform: translateY(-2px);
}

.article-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.article-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    flex: 1;
}

.article-card-h1 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.article-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.article-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.article-card-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

.article-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.article-status.draft {
    background: var(--background);
    color: var(--text-secondary);
}

.article-status.in-progress {
    background: var(--primary-light);
    color: var(--primary);
}

.article-status.completed {
    background: #d1fae5;
    color: var(--success);
}

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

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
}

/* Model Selector */
.model-selector-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.model-selector-container label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.model-selector {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-selector:hover {
    border-color: var(--primary);
}

.model-selector:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    padding: 2rem 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    gap: 8px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: var(--radius);
}

.step:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.step:active {
    transform: translateY(0);
}

.step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: var(--border);
    z-index: 0;
    transition: background 0.2s ease;
}

.step:last-child::after {
    display: none;
}

.step.active::after,
.step.completed::after {
    background: var(--primary);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.step.completed .step-number {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.step.completed .step-number::before {
    content: '✓';
    font-size: 16px;
}

.step-label {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
    transition: color 0.2s ease;
}

.step.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.step.completed .step-label {
    color: var(--text-secondary);
}

/* Step Content */
.step-content {
    display: none;
    padding: 2rem 0;
    max-width: 1440px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

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

.step-content.active {
    display: block;
}

.step-content h2 {
    margin-bottom: 32px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.success-icon {
    fill: #10b981;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s ease;
    background: var(--surface);
    color: var(--text-primary);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: var(--border);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

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

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

.btn-primary {
    background: var(--primary);
    color: #F4F4F4;
    box-shadow: none;
    border: 1px solid var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #CDD8DA;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-secondary svg {
    fill: var(--text-primary);
}

.btn-primary svg {
    fill: #F4F4F4;
}

/* Loading */
.loading {
    text-align: center;
    padding: 80px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.loading p {
    color: var(--text-secondary);
    margin-top: 24px;
    font-size: 15px;
    font-weight: 500;
}

.loading p:first-of-type {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-right: 4px solid var(--accent);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(22, 62, 71, 0.2);
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% { 
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Research Result */
.research-result {
    padding: 32px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.research-result p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
}

/* Editor Actions */
.editor-actions {
    margin-top: 32px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Structure Content */
#structureContent {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    min-height: 200px;
    box-shadow: var(--shadow-sm);
}

/* Sections Content */
#sectionsContent {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

/* Card Style */
.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

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

/* Notification */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    font-size: 14px;
    font-weight: 500;
}

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

.notification-success {
    background: #10b981;
    color: white;
}

.notification-error {
    background: #ef4444;
    color: white;
}

.notification-warning {
    background: #f59e0b;
    color: white;
}

.notification-info {
    background: var(--primary);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-header {
        padding: 16px;
    }

    .sidebar-header .logo {
        width: 120px;
    }

    .sidebar-nav {
        padding: 12px;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
    }

    .nav-item {
        flex-shrink: 0;
        width: auto;
        min-width: 140px;
    }

    .sidebar-footer {
        padding: 12px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-footer .btn {
        flex: 1;
        min-width: 120px;
    }

    .main-content {
        margin-left: 0;
    }

    .step-indicator {
        padding: 20px 16px;
        flex-wrap: wrap;
        gap: 16px;
    }

    .step {
        flex: 0 0 calc(50% - 8px);
        min-width: 120px;
    }

    .step::after {
        display: none;
    }

    .step-label {
        font-size: 11px;
    }

    .step-content {
        padding: 24px 16px;
    }

    .step-content h2 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .editor-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .notification {
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .view-container {
        padding: 20px 16px;
    }

    .articles-list {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--surface);
    border-radius: 2px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    margin: auto;
    position: relative;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

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

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

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

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

/* Token Footer - Element na dole */
.token-footer {
    background: var(--surface);
    border-top: 2px solid var(--primary);
    padding: 16px 24px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    margin-top: auto;
}

.token-footer-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.token-footer-main {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.token-footer-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.token-footer-stage {
    color: var(--primary);
    font-weight: 600;
}

.token-footer-separator {
    color: var(--border);
    margin: 0 4px;
}

.token-footer-count {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
}

.token-footer-total {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    padding: 8px 16px;
    background: var(--primary-light);
    border-radius: var(--radius);
    border: 1px solid var(--primary);
}

.token-footer-total-count {
    color: var(--primary-hover);
    font-weight: 700;
    font-size: 18px;
}

.token-footer-cost {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

/* Structure Selector */
.structure-selector {
    background: var(--surface);
}

/* H2 Block Styling */
.h2-block {
    transition: all 0.2s ease;
}

.h2-block:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.h2-block .checkbox-label {
    cursor: pointer;
}

.h3-list {
    animation: slideDown 0.2s ease;
}

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

.structure-section {
    margin-bottom: 24px;
}

.structure-item {
    transition: all 0.2s ease;
}

.structure-item:hover {
    transform: translateX(2px);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkbox-label span {
    flex: 1;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Section Editor */
.section-editor {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

/* Token Usage Panel - Stały element interfejsu */
.token-usage-panel {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #e0e7ff 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    font-size: 14px;
    color: var(--primary);
    display: none; /* Będzie zmienione na flex przez JS */
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.token-usage-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.token-usage-panel strong {
    color: var(--primary);
    font-weight: 600;
}

.token-usage-panel .token-count {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-hover);
    margin: 0 4px;
}

.token-usage-panel .token-details {
    font-size: 13px;
    opacity: 0.85;
    margin-left: 8px;
}

.token-usage-panel .token-cost {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    gap: 16px;
    align-items: center;
}

.token-usage-panel .token-cost strong {
    color: var(--primary-hover);
}

/* RAG Viewer */
.rag-viewer {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.rag-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    text-align: left;
}

.rag-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.rag-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.rag-section h4 {
    font-weight: 600;
    font-size: 17px;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rag-section h4::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.rag-section ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.rag-section li {
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
    line-height: 1.7;
    color: var(--text-primary);
    text-align: left;
}

.rag-section li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--primary);
    font-weight: bold;
    font-size: 18px;
}

.rag-section p {
    line-height: 1.7;
    color: var(--text-primary);
    text-align: left;
    margin: 0;
}

/* RAG Tags (for related topics) */
.rag-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.rag-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.rag-tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* TinyMCE Custom Styles */
.tox-tinymce {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
}

.tox .tox-toolbar {
    background: var(--background) !important;
    border-bottom: 1px solid var(--border) !important;
}

.tox .tox-edit-area__iframe {
    background: var(--surface) !important;
}

/* Sections Container Styles */
.sections-container {
    max-width: 100%;
}

.sections-header {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
    margin: -24px -24px 24px -24px;
    padding: 24px;
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Sequential Sections Styles */
.sections-sequential-container {
    max-width: 100%;
}

.sections-header-fixed {
    backdrop-filter: blur(10px);
    transition: box-shadow 0.2s ease;
}

.section-sequential-block {
    animation: fadeInUp 0.3s ease;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.section-sequential-block .section-editor-wrapper {
    min-height: 700px;
}

/* TinyMCE in sequential sections - larger height */
.section-sequential-block .tox-tinymce {
    min-height: 700px !important;
}

.section-sequential-block.next-section {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        border-color: var(--primary);
        opacity: 1;
    }
    50% {
        border-color: var(--primary);
        opacity: 0.7;
    }
}

.section-block {
    transition: box-shadow 0.2s ease;
}

.section-block:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.section-block-header:hover {
    background: var(--primary) !important;
}

.section-block-header h4 {
    transition: color 0.2s ease;
}

.section-block:hover .section-block-header h4 {
    color: var(--primary);
}

.section-toggle {
    color: var(--text-secondary);
}

.section-status {
    font-weight: 500;
}

.generate-next-section {
    transition: border-color 0.2s ease, background 0.2s ease;
}

.generate-next-section:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.all-sections-complete {
    animation: fadeInUp 0.3s ease;
}

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

/* Small button variant */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Section actions styling */
.section-actions {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

/* Imported Keywords List */
.imported-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 25px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--primary);
    transition: all 0.15s ease;
}

.keyword-tag:hover {
    background: var(--primary);
    color: white;
}

.keyword-tag .remove-keyword {
    margin-left: 6px;
    cursor: pointer;
    opacity: 0.7;
    font-size: 14px;
}

.keyword-tag .remove-keyword:hover {
    opacity: 1;
}

.csv-upload-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Final Review Styles */
/* Statistics cards hover effect */
#finalEditor .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.12);
}

#finalContentPreview h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.2;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 16px;
}

#finalContentPreview h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 16px;
    line-height: 1.3;
}

#finalContentPreview h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
    line-height: 1.3;
}

#finalContentPreview h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
}

#finalContentPreview p {
    margin-bottom: 16px;
    line-height: 1.8;
}

#finalContentPreview ul,
#finalContentPreview ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

#finalContentPreview li {
    margin-bottom: 8px;
    line-height: 1.7;
}

#finalContentPreview strong {
    font-weight: 600;
    color: var(--text-primary);
}

#finalContentPreview table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

#finalContentPreview th,
#finalContentPreview td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border);
}

#finalContentPreview th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-primary);
}

#finalContentPreview blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-style: italic;
}

#finalContentPreview code {
    background: var(--background);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

#finalContentPreview pre {
    background: var(--background);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 16px;
}

#finalContentPreview a {
    color: var(--primary);
    text-decoration: none;
}

#finalContentPreview a:hover {
    text-decoration: underline;
}

/* ============================================
   Content Review Styles (Step 7)
   ============================================ */

.review-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.review-summary-card {
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.review-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.review-summary-card .count {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.review-summary-card .label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-summary-card.errors {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #ef4444;
}

.review-summary-card.errors .count { color: #ef4444; }
.review-summary-card.errors .label { color: #b91c1c; }

.review-summary-card.warnings {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border-left: 4px solid #f59e0b;
}

.review-summary-card.warnings .count { color: #f59e0b; }
.review-summary-card.warnings .label { color: #b45309; }

.review-summary-card.suggestions {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
}

.review-summary-card.suggestions .count { color: #3b82f6; }
.review-summary-card.suggestions .label { color: #1d4ed8; }

.review-summary-card.score {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #10b981;
}

.review-summary-card.score .count { color: #10b981; }
.review-summary-card.score .label { color: #059669; }

.review-summary-card.score.needs-work {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border-left-color: #f59e0b;
}

.review-summary-card.score.needs-work .count { color: #f59e0b; }
.review-summary-card.score.needs-work .label { color: #b45309; }

.review-summary-card.score.poor {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left-color: #ef4444;
}

.review-summary-card.score.poor .count { color: #ef4444; }
.review-summary-card.score.poor .label { color: #b91c1c; }

/* Review Issues */
.review-issues {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-issue {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.review-issue:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}

.review-issue.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.review-issue-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.review-issue-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.review-issue-severity {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.review-issue-severity.error {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.review-issue-severity.warning {
    background: #fefce8;
    color: #f59e0b;
    border: 1px solid #fde68a;
}

.review-issue-severity.suggestion {
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #bfdbfe;
}

.review-issue-category {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.review-issue-title {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.review-issue-toggle {
    color: var(--text-muted);
    font-size: 18px;
    transition: transform 0.2s ease;
}

.review-issue.expanded .review-issue-toggle {
    transform: rotate(180deg);
}

.review-issue-body {
    display: none;
    padding: 20px;
}

.review-issue.expanded .review-issue-body {
    display: block;
}

.review-issue-description {
    margin-bottom: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.review-issue-location {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 8px 12px;
    background: var(--background);
    border-radius: var(--radius);
    display: inline-block;
}

.review-issue-diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .review-issue-diff {
        grid-template-columns: 1fr;
    }
}

.review-issue-original,
.review-issue-suggested {
    padding: 16px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.6;
}

.review-issue-original {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.review-issue-original::before {
    content: '❌ Oryginalny tekst';
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ef4444;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.review-issue-suggested {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.review-issue-suggested::before {
    content: '✅ Sugerowana poprawka';
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #10b981;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.review-issue-custom-fix {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.review-issue-custom-fix label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.review-issue-custom-fix textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.review-issue-custom-fix textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Applied Fixes Results */
.applied-fixes-results {
    margin-top: 24px;
}

.applied-fix-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.applied-fix-item.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.applied-fix-item.success .status-icon {
    color: #10b981;
}

.applied-fix-item.failed {
    background: #fef2f2;
    border-color: #fecaca;
}

.applied-fix-item.failed .status-icon {
    color: #ef4444;
}

.applied-fix-item .status-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.applied-fix-item .fix-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.applied-fix-item .fix-error {
    font-size: 13px;
    color: #ef4444;
}

/* Keywords Found/Missing */
.keywords-panel {
    margin-top: 20px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.keywords-panel h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.keyword-badge.found {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.keyword-badge.missing {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}


/* ================================================================
   BRIEF MODULE
   ================================================================ */

.brief-page {
    padding: 28px 32px;
    max-width: 1100px;
    margin: 0 auto;
}

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

.brief-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.brief-header-sub {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.brief-form-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

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

@media (max-width: 860px) { .brief-form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .brief-form-grid { grid-template-columns: 1fr; } }

.brief-progress {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    margin-bottom: 24px;
}

.brief-progress-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brief-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.brief-progress-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 15px;
}

.brief-progress-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bp-step {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    transition: all 0.3s;
}

.bp-step-pending  { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.bp-step-active   { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; font-weight: 600; }
.bp-step-done     { background: #d1fae5; color: #059669; border: 1px solid #a7f3d0; }
.bp-step-sep      { color: var(--text-secondary); font-size: 12px; }

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

.brief-result-keyword {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 10px;
}

.brief-result-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.brief-result-actions {
    display: flex;
    gap: 8px;
}

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

@media (max-width: 800px) { .brief-sections-grid { grid-template-columns: 1fr; } }

.brief-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.brief-card-wide { grid-column: 1 / -1; }

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

.brief-card-icon { font-size: 16px; line-height: 1; }

.brief-card-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.brief-card-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.brief-card-divider { height: 1px; background: var(--border); margin: 12px 0; }

.brief-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.brief-meta-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.brief-meta-value { font-size: 13px; color: var(--text-primary); line-height: 1.5; }

.brief-kw-group { margin-bottom: 10px; }

.brief-kw-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.brief-kw-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.brief-tag { font-size: 12px; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }

.tag-main     { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; font-weight: 700; }
.tag-semantic { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.tag-lsi      { background: #fefce8; color: #854d0e; border: 1px solid #fde68a; }
.tag-question { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.tag-longtail { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }

.brief-struct-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.brief-struct-item:last-child { border-bottom: none; padding-bottom: 0; }

.brief-struct-h2 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.brief-struct-h3 { font-size: 12px; color: var(--text-secondary); padding-left: 12px; margin-bottom: 2px; }

.brief-struct-hint {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
    padding: 4px 8px;
    background: var(--bg);
    border-left: 3px solid var(--border);
    border-radius: 0 4px 4px 0;
}

.brief-snippet-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 7px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 10px;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.brief-bullet-list {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
}

.brief-bullet-list li + li { margin-top: 3px; }

.brief-tech-row {
    font-size: 13px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.brief-tech-label { font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }

.brief-small-list { margin: 4px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.6; }

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

.brief-source-card {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.brief-source-pos {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.brief-source-body { flex: 1; min-width: 0; }

.brief-source-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.brief-source-title:hover { text-decoration: underline; }

.brief-source-domain { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }

.brief-source-headings { display: flex; flex-wrap: wrap; gap: 4px; }

.brief-source-h2 {
    font-size: 11px;
    padding: 2px 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}