@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f0f0f;
    --bg-surface: #161616;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    --text-dim: rgba(255, 255, 255, 0.25);
    --accent: #ff6b2b;
    --accent-hover: #ff8c55;
    --accent-dim: rgba(255, 107, 43, 0.12);
    --radius: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --platform-youtube: #ff0000;
    --platform-tiktok: #ffffff;
    --platform-instagram: #e1306c;
    --platform-x: #ffffff;
    --platform-twitter: #1da1f2;
    --platform-linkedin: #0077b5;
    --platform-facebook: #1877f2;

    --card-bg: var(--bg-card);
    --border-color: var(--border);
    --surface: var(--bg-surface);
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* === LAYOUT === */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === HEADER === */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    padding-top: 16px;
    padding-bottom: 16px;
}

.site-header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    height: 40px;
    width: auto;
}

/* Hamburger button — hidden on desktop */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 4px;
}

.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: background 0.2s;
}

.nav-hamburger:hover span {
    background: var(--text);
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a.active {
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
}

/* === FOOTER === */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 64px;
    text-align: center;
}

.site-footer small {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* === SEARCH SECTION === */
.search-section {
    padding: 48px 0 24px;
}

.search-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.search-section .subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
    margin-bottom: 32px;
}

/* === SEARCH FORM === */
#search-form {
    margin-bottom: 0;
}

.search-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
}

.search-grid input[type="search"],
.search-grid select {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    height: 48px;
}

.search-grid input[type="search"]:focus,
.search-grid select:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.search-grid input[type="search"]::placeholder {
    color: var(--text-dim);
}

.search-grid select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.4)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.search-grid select option {
    background: var(--bg-surface);
    color: var(--text);
}

/* === TAG CLOUD === */
.tag-cloud-section {
    padding: 24px 0 16px;
}

.tag-cloud-section h4 {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: calc(0.75rem + var(--tag-weight, 1) * 0.04rem);
    font-weight: 500;
    opacity: calc(0.6 + var(--tag-weight, 1) * 0.08);
    transition: all 0.2s ease;
    text-decoration: none;
}

.tag-cloud-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    color: var(--text);
}

.tag-category {
    margin-bottom: 20px;
}

.tag-category-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

/* === DIVIDER === */
.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

/* === RESULTS === */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2px;
}

/* === SUMMARY CARDS === */
.summary-card {
    background: transparent;
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
}

.summary-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.summary-card .card-content {
    display: flex;
    gap: 20px;
}

.summary-card .card-thumbnail {
    flex-shrink: 0;
    width: 180px;
    height: 100px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    display: block;
    transition: opacity 0.2s;
}

.summary-card .card-thumbnail:hover {
    opacity: 0.85;
}

.summary-card .card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-card .card-thumbnail.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid var(--border);
}

.summary-card .card-thumbnail.no-image img {
    display: none;
}

.summary-card .card-thumbnail.no-image::after {
    content: "\1F4F7";
}

.summary-card .card-thumbnail.no-image[data-platform="instagram"]::after {
    content: "\1F4F7";
}

.summary-card .card-thumbnail.no-image[data-platform="tiktok"]::after {
    content: "\1F3B5";
}

.summary-card .card-thumbnail.no-image[data-platform="youtube"]::after {
    content: "\25B6\FE0F";
}

.summary-card .card-thumbnail.no-image[data-platform="x"]::after {
    content: "\1D54F";
}

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

.summary-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    letter-spacing: -0.01em;
}

.summary-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 8px;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.platform-youtube { background: var(--platform-youtube); color: white; }
.platform-tiktok { background: var(--platform-tiktok); color: #0f0f0f; }
.platform-instagram { background: var(--platform-instagram); color: white; }
.platform-x { background: var(--platform-x); color: #0f0f0f; }
.platform-twitter { background: var(--platform-twitter); color: white; }
.platform-linkedin { background: var(--platform-linkedin); color: white; }
.platform-facebook { background: var(--platform-facebook); color: white; }

.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.author {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.summary-preview {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.6;
    margin-top: 8px;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === NO RESULTS === */
.no-results {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.no-results p {
    margin-bottom: 8px;
}

/* === LOAD MORE === */
.load-more {
    text-align: center;
    padding: 32px 0;
}

.load-more button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.load-more button:hover,
.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: var(--text);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 600;
}

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

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    font-weight: 600;
}

.btn-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* === DETAIL PAGE === */
.detail-header {
    padding: 32px 0 16px;
}

.breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8125rem;
}

.breadcrumb a {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--text);
}

.breadcrumb .separator {
    color: var(--text-dim);
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.detail-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.3;
    margin-top: 16px;
    margin-bottom: 4px;
}

.thumbnail {
    max-width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.summary-content {
    line-height: 1.8;
    white-space: pre-wrap;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: var(--accent-dim);
    border: 1px solid rgba(255, 107, 43, 0.15);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
}

.raw-content {
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.raw-content pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text-muted);
    font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
}

details {
    margin-top: 24px;
}

details summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.2s;
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: "+ ";
    font-weight: 400;
}

details[open] summary::before {
    content: "- ";
}

details summary:hover {
    color: var(--text);
}

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

/* === PAGINATION === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 32px 0 16px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.pagination-btn.disabled {
    color: var(--text-dim);
    pointer-events: none;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 2px;
}

.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination-num:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.pagination-num.active {
    background: var(--accent);
    color: white;
}

.pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-dim);
    font-size: 0.8125rem;
}

/* === FOOTER === */
.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-social {
    display: inline-flex;
    align-items: center;
    color: var(--text-dim);
    transition: color 0.2s;
}

.footer-social:hover {
    color: #0077b5;
}

/* === HTMX === */
.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-indicator {
    display: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .site-header .container {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        padding: 8px 0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        z-index: 200;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 10px 24px;
        font-size: 0.875rem;
    }

    .nav-links a.active {
        border-bottom: none;
        padding-bottom: 10px;
        color: var(--accent);
    }

    .nav-tools {
        padding: 0 24px;
    }

    .nav-tools-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 10px 0;
        font-size: 0.875rem;
    }

    .nav-tools.has-active .nav-tools-btn {
        border-bottom: none;
        padding-bottom: 10px;
        color: var(--accent);
    }

    .nav-tools-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: none;
        padding: 0;
        margin-top: 0;
        transform: none;
    }

    .nav-tools.open .nav-tools-dropdown {
        display: flex;
        flex-direction: column;
    }

    .nav-tools-dropdown a {
        padding: 8px 0 8px 12px;
        font-size: 0.875rem;
    }

    .nav-accordion {
        border-top: 1px solid var(--border);
    }

    .nav-accordion:first-child {
        border-top: none;
    }

    .nav-accordion-btn {
        padding: 10px 0;
        font-size: 0.875rem;
    }

    .nav-accordion-items a {
        padding: 6px 0 6px 16px;
        font-size: 0.875rem;
    }

    .nav-settings {
        padding: 4px 24px;
        border-top: 1px solid var(--border);
        margin-top: 4px;
        padding-top: 8px;
    }

    .nav-settings-btn {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        padding: 6px 0;
    }

    .nav-settings-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: none;
        padding: 0;
        margin-top: 4px;
    }

    .nav-settings.open .nav-settings-dropdown {
        display: flex;
        flex-direction: column;
    }

    .nav-settings-dropdown a {
        padding: 8px 0 8px 12px;
    }

    .site-header nav {
        position: relative;
    }

    .brand-logo {
        height: 32px;
    }

    .search-section {
        padding: 32px 0 16px;
    }

    .search-section h1 {
        font-size: 1.75rem;
    }

    .search-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .search-grid input[type="search"],
    .search-grid select {
        height: 44px;
    }

    .summary-card {
        padding: 16px;
    }

    .summary-card .card-content {
        flex-direction: column;
        gap: 12px;
    }

    .summary-card .card-thumbnail {
        width: 100%;
        height: 200px;
    }

    .summary-meta {
        gap: 6px;
    }

    .detail-card {
        padding: 20px;
        border-radius: var(--radius-md);
    }

    .detail-card h2 {
        font-size: 1.25rem;
    }

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

    .detail-actions .btn {
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .search-section {
        padding: 24px 0 12px;
    }

    .search-section h1 {
        font-size: 1.5rem;
    }

    .summary-card {
        padding: 12px;
    }

    .tag-cloud {
        gap: 6px;
    }

    .tag-cloud-item {
        padding: 4px 10px;
        font-size: 0.6875rem;
    }
}

/* === CRAWL PAGE === */
.crawl-form .search-grid {
    grid-template-columns: 1fr 100px auto;
}

.crawl-form input[type="number"] {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    height: 48px;
    text-align: center;
}

.crawl-form input[type="number"]:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.crawl-form input[type="url"] {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    height: 48px;
}

.crawl-form input[type="url"]:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.crawl-form input[type="url"]::placeholder {
    color: var(--text-dim);
}

.crawl-status {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.crawl-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.crawl-results-section {
    padding: 24px 0;
}

.crawl-results-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.crawl-results-table {
    width: 100%;
    border-collapse: collapse;
}

.crawl-results-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
}

.crawl-results-table td {
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.crawl-results-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.crawl-results-table td a {
    color: var(--accent);
    font-weight: 500;
}

.no-results-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 16px;
}

.crawl-error {
    padding: 24px;
    margin-top: 24px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--radius-md);
    color: #ef4444;
    font-size: 0.875rem;
}

/* === CRAWL JOB CARDS === */
.crawl-job {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-top: 16px;
    transition: border-color 0.3s;
}

.crawl-job.running {
    border-color: var(--accent);
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--accent); }
    50% { border-color: rgba(255, 107, 43, 0.3); }
}

.crawl-job-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.crawl-job-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crawl-job-domain {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.crawl-job-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.crawl-job-empty {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-running {
    background: rgba(255, 107, 43, 0.15);
    color: var(--accent);
}

.status-done {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-error {
    background: rgba(220, 38, 38, 0.15);
    color: #ef4444;
}

.type-badge--ready {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.type-badge--processing {
    background: rgba(255, 107, 43, 0.15);
    color: var(--accent);
}

.type-badge--error {
    background: rgba(220, 38, 38, 0.15);
    color: #ef4444;
}

.type-badge--empty {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.type-badge--draft {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.type-badge--active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.type-badge--archived {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim, #666);
}

.crawl-spinner-sm {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1.5px solid rgba(255, 107, 43, 0.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.crawl-job details {
    margin-top: 12px;
}

.crawl-job .crawl-results-table {
    margin-top: 8px;
}

.crawl-job .crawl-error {
    margin-top: 12px;
}

.crawl-actions-cell {
    display: flex;
    gap: 10px;
    align-items: center;
}

.copy-link-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: var(--text);
}

.copy-link-btn.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

@media (max-width: 768px) {
    .crawl-form .search-grid {
        grid-template-columns: 1fr;
    }

    .crawl-job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* === LOGIN PAGE === */
.login-page {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 100px;
}

.login-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.login-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.login-inline {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 360px;
    padding: 0 24px;
}

.login-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input::placeholder {
    color: var(--text-dim);
}

.login-input:focus {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.login-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.login-error {
    padding: 10px 16px;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--radius-sm);
    color: #ef4444;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Logout link in nav (legacy, kept for compat) */
.nav-logout {
    color: var(--text-muted) !important;
    font-size: 0.8125rem !important;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
}

.nav-logout:hover {
    opacity: 1;
    color: var(--text) !important;
}

/* Tools nav dropdown */
.nav-tools {
    position: relative;
}

.nav-tools-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.nav-tools-btn svg {
    transition: transform 0.2s;
}

.nav-tools.open .nav-tools-btn svg {
    transform: rotate(180deg);
}

.nav-tools-btn:hover,
.nav-tools.open .nav-tools-btn,
.nav-tools.has-active .nav-tools-btn {
    color: var(--text);
}

.nav-tools.has-active .nav-tools-btn {
    border-bottom: 2px solid var(--accent);
    padding-bottom: 4px;
}

.nav-tools-dropdown {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 8px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 160px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 200;
}

.nav-tools.open .nav-tools-dropdown {
    display: block;
}

.nav-tools-dropdown a {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.nav-tools-dropdown a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.nav-tools-dropdown a.active {
    color: var(--accent);
}

.nav-accordion {
    border-top: 1px solid var(--border);
}

.nav-accordion:first-child {
    border-top: none;
}

.nav-accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
}

.nav-accordion-btn:hover {
    color: var(--text);
}

.nav-accordion-btn svg {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.nav-accordion.open .nav-accordion-btn svg {
    transform: rotate(180deg);
}

.nav-accordion.open .nav-accordion-btn {
    color: var(--text);
}

.nav-accordion-items {
    display: none;
    padding-bottom: 4px;
}

.nav-accordion.open .nav-accordion-items {
    display: block;
}

.nav-accordion-items a {
    display: block;
    padding: 6px 16px 6px 28px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.nav-accordion-items a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.nav-accordion-items a.active {
    color: var(--accent);
}

/* Settings gear dropdown */
.nav-settings {
    position: relative;
}

.nav-settings-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.nav-settings-btn:hover,
.nav-settings.open .nav-settings-btn {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.nav-settings-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 160px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 200;
}

.nav-settings.open .nav-settings-dropdown {
    display: block;
}

.nav-settings-dropdown a {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.nav-settings-dropdown a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.nav-dropdown-logout {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 10px !important;
    color: var(--text-muted) !important;
}

.nav-dropdown-logout:hover {
    color: var(--text) !important;
}

.nav-logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: inherit;
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 10px;
    transition: background 0.15s, color 0.15s;
}

.nav-logout-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

@media (max-width: 480px) {
    .login-inline {
        flex-direction: column;
        padding: 0 16px;
    }

    .login-inline .login-input,
    .login-inline .login-btn {
        width: 100%;
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* === VOICE MEMOS === */
.memo-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.memo-upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/static/robots.png') center / cover no-repeat;
    filter: grayscale(100%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.memo-upload-zone > * {
    position: relative;
    z-index: 1;
}

.memo-upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(255, 107, 43, 0.05);
}

.memo-upload-zone .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.memo-upload-zone p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.memo-upload-zone .upload-or {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin: 8px 0;
}

.memo-upload-zone .upload-hint {
    color: var(--accent);
    font-weight: 500;
    margin-top: 8px;
}

.upload-label {
    cursor: pointer;
}

.upload-estimate {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 8px;
    text-align: center;
}

.memo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-top: 16px;
}

.memo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.memo-toggle {
    cursor: pointer;
    user-select: none;
}

.memo-toggle:hover {
    opacity: 0.8;
}

.memo-chevron {
    font-size: 0.7rem;
    margin-right: 6px;
    display: inline-block;
    color: var(--text-muted);
}

.memo-body {
    padding-top: 12px;
}

.memo-card-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.memo-status-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.memo-filename {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.memo-summary {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-top: 12px;
}

.memo-summary-full {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.8;
}

/* Old JSON-style headings (h4) */
.memo-summary-full h4 {
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 16px;
    margin-bottom: 6px;
}

.memo-summary-full h4:first-child {
    margin-top: 0;
}

/* Markdown headings from GPT summaries */
.memo-summary-full h3 {
    color: var(--accent);
    font-size: 0.9375rem;
    font-weight: 700;
    margin-top: 36px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.memo-summary-full h3:first-child {
    margin-top: 0;
}

.memo-summary-full p {
    margin-bottom: 12px;
    max-width: 72ch;
}

.memo-summary-full ul {
    padding-left: 28px;
    margin: 6px 0 12px;
}

.memo-summary-full li {
    margin-bottom: 2px;
    max-width: 72ch;
}

.memo-summary-full strong {
    color: var(--text);
}

.memo-summary-full em {
    color: var(--text-muted);
    font-style: italic;
}

.memo-copy-btn {
    margin-top: 10px;
}

.memo-card-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .memo-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .memo-upload-zone {
        padding: 32px 16px;
    }
}

/* === DASHBOARD === */
.dashboard-section {
    margin-bottom: 48px;
}

.dashboard-heading {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--text);
}

.dashboard-heading .text-muted {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.875rem;
}

.dashboard-subheading {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 24px;
    margin-bottom: 12px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.dash-card-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.dash-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.dash-card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dash-card-detail {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dash-card-cost {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.dashboard-table-wrapper {
    margin-top: 16px;
    overflow-x: auto;
}

.dashboard-table-wrapper code {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Service status */
.service-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: capitalize;
}

.service-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.service-active .service-dot {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.service-active {
    color: #22c55e;
}

.service-inactive .service-dot,
.service-failed .service-dot {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.service-inactive,
.service-failed {
    color: #ef4444;
}

.service-unknown .service-dot {
    background: var(--text-muted);
}

.service-unknown {
    color: var(--text-muted);
}

/* Resource bars */
.dashboard-resources {
    margin-top: 16px;
}

.resource-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resource-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resource-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.resource-bar {
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
}

.resource-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.dashboard-logs {
    margin-top: 24px;
}

@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* === BBQ PAGE === */
.bbq-input {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    height: 48px;
}

.bbq-input:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.bbq-input::placeholder {
    color: var(--text-dim);
}

.bbq-result {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 32px;
    margin-top: 24px;
}

.bbq-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.bbq-result-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.bbq-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.bbq-result-content {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.8;
}

.bbq-result-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 16px;
    margin-bottom: 8px;
}

.bbq-result-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 16px;
    margin-bottom: 6px;
}

.bbq-result-content ul,
.bbq-result-content ol {
    padding-left: 24px;
    margin: 8px 0;
}

.bbq-result-content li {
    margin-bottom: 4px;
}

.bbq-result-content p {
    margin-bottom: 8px;
}

.bbq-result-content strong {
    color: var(--text);
}

.bbq-sources {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.bbq-sources h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.bbq-sources ul {
    list-style: none;
    padding: 0;
}

.bbq-sources li {
    font-size: 0.8125rem;
    margin-bottom: 4px;
}

.bbq-sources a {
    color: var(--accent);
    word-break: break-all;
}

.bbq-saved-section {
    margin-top: 32px;
}

.bbq-saved-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.bbq-stars {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

.bbq-star {
    font-size: 1.1rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
    line-height: 1;
}

.bbq-star:hover {
    transform: scale(1.15);
}

.bbq-star.filled {
    color: #f59e0b;
}

.bbq-stars:hover .bbq-star {
    color: var(--text-dim);
}

.bbq-stars:hover .bbq-star.hovered {
    color: #f59e0b;
}

.bbq-title-edit {
    background: var(--bg-surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 4px 10px;
    outline: none;
    width: 300px;
    max-width: 100%;
}

.bbq-original-query {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}

.bbq-title-display {
    cursor: text;
}

.bbq-title-display:hover {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
    text-decoration-color: var(--text-dim);
}

@media (max-width: 768px) {
    .bbq-result {
        padding: 16px 20px;
    }
}

/* === BLOG === */

.blog-card {
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.blog-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.blog-card:hover .blog-read-more {
    color: var(--accent);
}

.blog-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.blog-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.blog-card h3 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-card h3 a:hover {
    color: var(--accent);
}

.blog-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 2px;
}

.blog-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 2px;
}

.blog-meta:last-of-type {
    margin-bottom: 8px;
}

.blog-updated {
    margin-top: -4px;
}

.blog-excerpt {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-read-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

.blog-draft {
    border-left: 3px solid var(--accent);
    padding-left: 21px;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.badge-draft {
    background: rgba(255, 107, 43, 0.15);
    color: var(--accent);
}

/* Blog article (single post) */
.blog-article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
}

.blog-article h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.2;
    margin-bottom: 8px;
}

.blog-content {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.8;
    margin-top: 24px;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    color: var(--text);
    margin-top: 32px;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.blog-content h1 { font-size: 1.75rem; font-weight: 800; }
.blog-content h2 { font-size: 1.375rem; font-weight: 700; }
.blog-content h3 { font-size: 1.125rem; font-weight: 600; }

.blog-content p {
    margin-bottom: 16px;
}

.blog-content ul,
.blog-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.blog-content li {
    margin-bottom: 6px;
}

.blog-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.blog-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 16px 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.blog-content pre {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 16px 0;
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.7;
    font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
}

.blog-content code {
    font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

.blog-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: var(--text-secondary);
}

.blog-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.blog-content th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
}

.blog-content td {
    padding: 10px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}

.blog-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

.blog-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.back-link {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text);
}

/* Blog form */
.blog-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-group input[type="text"] {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    padding: 14px 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
}

.form-group input[type="text"]:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.form-group input[type="text"]::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

.form-group textarea {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    padding: 16px 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    resize: vertical;
    line-height: 1.7;
}

.form-group textarea:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.form-group textarea::placeholder {
    color: var(--text-dim);
}

.form-check label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 600;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: var(--text);
}

@media (max-width: 768px) {
    .blog-article {
        padding: 24px;
        border-radius: var(--radius-md);
    }

    .blog-article h1 {
        font-size: 1.5rem;
    }

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

    .blog-actions .btn {
        text-align: center;
        justify-content: center;
    }

    .form-group input[type="text"] {
        font-size: 1rem;
    }
}

/* === SERVICES PAGE === */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color 0.2s;
}

.service-card:hover {
    border-color: var(--border-hover);
}

.service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.service-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.service-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.service-badge--ai { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.service-badge--audio { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.service-badge--search { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.service-badge--messaging { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.service-badge--meetings { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.service-badge--calendar { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.service-badge--trading { background: rgba(250, 204, 21, 0.15); color: #facc15; }
.service-badge--scraper { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }
.service-badge--video { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.service-badge--database { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; }
.service-badge--analytics { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }

.service-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.service-meta {
    margin-bottom: 10px;
}

.service-model {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 4px;
}

.service-status {
    font-size: 0.75rem;
    font-weight: 500;
}

.service-status.active {
    color: #4ade80;
}

.service-status.inactive {
    color: var(--text-muted);
}

.service-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.service-link {
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.service-link:hover {
    color: var(--accent-hover);
}

.service-link--sub {
    color: var(--text-muted);
    border-left: 1px solid var(--border);
    padding-left: 12px;
}

.service-link--sub:hover {
    color: var(--text-secondary);
}

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

/* === LINKEDIN GENERATOR === */
.linkedin-gen-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.linkedin-output {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 600px;
    overflow-y: auto;
}

/* === TRENDING TOPICS === */
.trending-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.trending-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    margin: 0 16px;
}

.trending-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.trending-platform-checkboxes {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.trending-platform-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.trending-platform-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.trending-topics-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 32px;
}

.trending-topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    transition: border-color 0.2s;
}

.trending-topic-card:hover {
    border-color: var(--border-hover);
}

.trending-topic-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.trending-topic-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.trending-result {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.trending-result-summary {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.75;
}

.trending-result-summary h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.trending-result-summary h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 16px 0 6px;
}

.trending-result-summary p {
    margin-bottom: 10px;
}

.trending-result-summary strong {
    color: var(--text);
    font-weight: 600;
}

.trending-result-summary em {
    color: var(--text-secondary);
    font-style: italic;
}

.trending-result-summary a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.trending-result-summary a:hover {
    border-bottom-color: var(--accent);
}

.trending-result-summary ul,
.trending-result-summary ol {
    margin: 8px 0 12px;
    padding-left: 20px;
}

.trending-result-summary li {
    margin-bottom: 4px;
    padding-left: 4px;
}

.trending-result-summary li::marker {
    color: var(--accent);
}

.trending-result-summary blockquote {
    margin: 12px 0;
    padding: 10px 16px;
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-style: italic;
}

.trending-result-summary blockquote p {
    margin-bottom: 0;
}

.trending-result-summary code {
    font-size: 0.85em;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    color: var(--accent);
}

.trending-result-summary hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

.trending-items-list {
    margin-top: 8px;
}

.trending-items-list a {
    color: var(--accent);
    font-size: 0.875rem;
}

.trending-no-results {
    margin-top: 16px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
}

.trending-scraping-status {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 16px 20px;
    background: var(--accent-dim);
    border: 1px solid rgba(255, 107, 43, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    animation: trending-fade-in 0.3s ease;
}

.trending-scrape-error {
    margin-top: 16px;
    padding: 14px 20px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--radius-sm);
    color: #ef4444;
    font-size: 0.8125rem;
    font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
    word-break: break-word;
}

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

@media (max-width: 768px) {
    .trending-topic-header {
        flex-direction: column;
    }

    .trending-topic-actions {
        width: 100%;
    }

    .trending-modal-content {
        padding: 24px;
    }
}

/* === TREND RADAR === */
.radar-sources-panel {
    margin-top: 8px;
    margin-bottom: 24px;
}

.radar-sources-panel > summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 12px 0;
}

.radar-sources-content {
    margin-top: 12px;
}

.radar-sources-content .crawl-results-table td {
    font-size: 0.8125rem;
    padding: 10px 12px;
}

.radar-sources-content .crawl-results-table th {
    padding: 8px 12px;
}

.radar-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.radar-cat-onderwijs { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.radar-cat-mbo { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.radar-cat-edtech { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.radar-cat-zorg { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.radar-cat-serious_games { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.radar-cat-tech { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.radar-cat-nieuws { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }

.radar-results-section {
    margin-top: 24px;
    padding-bottom: 32px;
}

.radar-summary-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 16px;
}

.radar-articles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radar-article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    transition: border-color 0.2s;
}

.radar-article-card:hover {
    border-color: var(--border-hover);
}

.radar-article-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.radar-article-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.4;
}

.radar-article-title:hover {
    color: var(--accent);
}

.radar-article-reason {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-top: 8px;
}

.radar-score {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.radar-score-high {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.radar-score-mid {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
}

.radar-score-low {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.radar-seo-details {
    margin-top: 12px;
}

.radar-seo-details > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.radar-seo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.radar-seo-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radar-seo-full {
    grid-column: 1 / -1;
}

.radar-seo-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.radar-seo-value {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.radar-seo-brief {
    padding-left: 18px;
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.radar-seo-brief li {
    margin-bottom: 2px;
}

/* Radar run panels */
.radar-runs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.radar-run-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.radar-run-panel[open] {
    border-color: var(--accent-primary);
}

.radar-run-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    gap: 12px;
}

.radar-run-summary::-webkit-details-marker {
    display: none;
}

.radar-run-summary::before {
    content: "\25B6";
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.radar-run-panel[open] > .radar-run-summary::before {
    transform: rotate(90deg);
}

.radar-run-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.radar-run-date {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.radar-run-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.radar-hot-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.radar-run-status {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.radar-status-done {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.radar-status-running {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.radar-status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.radar-run-actions {
    display: flex;
    gap: 8px;
}

.radar-run-content {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
}

.radar-error {
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: #ef4444;
    font-size: 0.8125rem;
    margin-top: 16px;
}

.radar-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .radar-seo-grid {
        grid-template-columns: 1fr;
    }

    .radar-article-header {
        flex-direction: column;
    }

    .radar-summary-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .radar-sources-content .crawl-results-table {
        font-size: 0.75rem;
    }

    .radar-run-summary {
        flex-wrap: wrap;
    }

    .radar-run-header {
        flex-basis: 100%;
        margin-bottom: 8px;
    }

    .radar-run-actions {
        margin-left: auto;
    }
}

/* === RONSTER (RECEIPT SERVICE) === */
.ronster-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.ronster-date-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ronster-date-input {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ronster-date-input:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

.receipt-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    margin-bottom: 32px;
}

.receipt-upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(255, 107, 43, 0.05);
}

.receipt-upload-zone .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.receipt-upload-zone p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.receipt-upload-zone .upload-or {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin: 8px 0;
}

.receipt-upload-zone .upload-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 12px;
}

.receipt-upload-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--accent-dim);
    border: 1px solid rgba(255, 107, 43, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 24px;
}

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

.receipt-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s;
}

.receipt-card:hover {
    border-color: var(--border-hover);
}

.receipt-thumbnail {
    position: relative;
    height: 160px;
    background: var(--bg-surface);
    cursor: pointer;
    overflow: hidden;
}

.receipt-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.receipt-thumbnail:hover img {
    transform: scale(1.03);
}

.receipt-thumbnail.no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-dim);
}

.receipt-thumbnail.no-thumb::after {
    content: "📄";
}

.receipt-processing {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.receipt-info {
    padding: 16px;
}

.receipt-vendor {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.receipt-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.receipt-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 8px;
}

.receipt-cat-food { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.receipt-cat-transport { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.receipt-cat-office { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.receipt-cat-entertainment { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.receipt-cat-utilities { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.receipt-cat-other { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }

.receipt-actions {
    padding: 0 16px 16px;
    display: flex;
    gap: 8px;
}

/* Receipt Modal */
.receipt-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.receipt-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    margin: 16px;
    display: grid;
    grid-template-columns: 1fr 320px;
    overflow: hidden;
    position: relative;
}

.receipt-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.receipt-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.receipt-modal-image {
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 90vh;
    overflow: auto;
}

.receipt-modal-image img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.receipt-modal-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.receipt-modal-form .form-group {
    gap: 6px;
}

.receipt-modal-form .form-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ronster-input {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 10px 14px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}

.ronster-input:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

.ronster-select {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 10px 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ronster-select:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

.receipt-amount-input {
    display: flex;
    gap: 8px;
}

.receipt-amount-input .ronster-select {
    width: 80px;
    flex-shrink: 0;
}

.receipt-amount-input .ronster-input {
    flex: 1;
}

@media (max-width: 768px) {
    .ronster-date-filters {
        width: 100%;
    }

    .ronster-date-input {
        flex: 1;
    }

    .receipt-grid {
        grid-template-columns: 1fr;
    }

    .receipt-modal-content {
        grid-template-columns: 1fr;
        max-height: 95vh;
    }

    .receipt-modal-image {
        max-height: 40vh;
    }

    .receipt-modal-form {
        padding: 20px;
    }
}

/* === GAMES PAGE === */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.game-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.game-card-image {
    aspect-ratio: 16 / 9;
    background: var(--bg-surface);
    overflow: hidden;
}

.game-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-dim), rgba(255, 107, 43, 0.05));
}

.game-card-placeholder span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.game-card-info {
    padding: 20px;
}

.game-card-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.game-card-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

/* === LINKER PAGE === */
.linker-add {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.linker-add input[type="url"],
.linker-add input[type="text"] {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 12px 16px;
    outline: none;
    height: 48px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.linker-add input[type="url"]:focus,
.linker-add input[type="text"]:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.linker-add input[type="url"]::placeholder,
.linker-add input[type="text"]::placeholder {
    color: var(--text-dim);
}

.linker-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--accent-dim);
    border: 1px solid rgba(255, 107, 43, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    cursor: pointer;
}

.tag-chip:hover {
    background: var(--accent-dim);
    border-color: rgba(255, 107, 43, 0.3);
    color: var(--accent);
}

.link-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s, background 0.2s;
}

.summary-card:hover .link-delete-btn {
    opacity: 1;
}

.link-delete-btn:hover {
    color: #ef4444;
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
}

.summary-card {
    position: relative;
}

@media (max-width: 768px) {
    .linker-add {
        flex-direction: column;
    }

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

/* === MARKDOWN PAGE === */
.md-add-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.md-title-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
}

.md-title-input:focus {
    outline: none;
    border-color: var(--accent);
}

.md-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 80px;
}

.md-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.md-add-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.md-upload-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.md-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* === RENDERED MARKDOWN === */
.md-rendered {
    line-height: 1.7;
    color: var(--text-secondary);
}

.md-rendered h1,
.md-rendered h2,
.md-rendered h3,
.md-rendered h4,
.md-rendered h5,
.md-rendered h6 {
    color: var(--text);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

.md-rendered h1 { font-size: 1.6rem; }
.md-rendered h2 { font-size: 1.35rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.md-rendered h3 { font-size: 1.15rem; }
.md-rendered h4 { font-size: 1rem; }

.md-rendered p {
    margin-bottom: 1em;
}

.md-rendered ul,
.md-rendered ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.md-rendered li {
    margin-bottom: 0.3em;
}

.md-rendered blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5em 1em;
    margin: 1em 0;
    background: var(--bg-surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.md-rendered code {
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'Courier New', monospace;
    color: var(--accent);
}

.md-rendered pre {
    background: var(--bg-surface);
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 1em;
    border: 1px solid var(--border);
}

.md-rendered pre code {
    background: none;
    padding: 0;
    color: var(--text-secondary);
}

.md-rendered table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.md-rendered th,
.md-rendered td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.md-rendered th {
    background: var(--bg-surface);
    color: var(--text);
    font-weight: 600;
}

.md-rendered tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.md-rendered a {
    color: var(--accent);
    text-decoration: underline;
}

.md-rendered img {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.md-rendered hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5em 0;
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: auto;
    max-width: 400px;
}

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-error { border-color: #dc2626; }
.toast-success { border-color: #22c55e; }
.toast-info { border-color: var(--accent); }

/* === Confirm Dialog === */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.2s;
}

.confirm-visible {
    opacity: 1;
}

.confirm-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    max-width: 400px;
    width: 90%;
}

.confirm-box p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* === Utility Classes === */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; gap: 12px; }
.flex-gap-sm  { display: flex; gap: 6px; }
.flex-wrap    { flex-wrap: wrap; }
.gap-md       { gap: 12px; }
.mt-sm        { margin-top: 0.5rem; }
.mt-md        { margin-top: 1rem; }
.mt-lg        { margin-top: 1.5rem; }
.mt-xl        { margin-top: 2rem; }
.mb-sm        { margin-bottom: 8px; }
.mb-md        { margin-bottom: 12px; }
.ml-auto      { margin-left: auto; }
.mr-sm        { margin-right: 8px; }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-sm      { font-size: 0.85rem; }
.text-xs      { font-size: 0.8rem; }
.text-xxs     { font-size: 0.75rem; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.w-full       { width: 100%; }
.flex-1       { flex: 1; }
.flex-col     { display: flex; flex-direction: column; }
.gap-sm       { gap: 8px; }
.gap-xs       { gap: 6px; }
.gap-lg       { gap: 1rem; }
.p-md         { padding: 12px; }
.px-md        { padding-left: 12px; padding-right: 12px; }
.py-sm        { padding-top: 8px; padding-bottom: 8px; }
.nowrap       { white-space: nowrap; }
.overflow-auto { overflow: auto; }
.flex          { display: flex; }
.block        { display: block; }
.inline-block { display: inline-block; }
.items-center { align-items: center; }
.label-sm     { font-size: 0.85rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
.form-group-mt { margin-top: 16px; }
.form-input   { width: 100%; background: var(--card-bg, var(--bg)); color: var(--text-color, var(--text)); border: 1px solid var(--border-color, var(--border)); border-radius: 8px; padding: 10px 14px; font-family: inherit; font-size: 0.95rem; box-sizing: border-box; }
.form-input-sm { width: 100%; background: var(--card-bg, var(--bg)); color: var(--text-color, var(--text)); border: 1px solid var(--border-color, var(--border)); border-radius: 8px; padding: 8px 12px; font-family: inherit; font-size: 0.9rem; box-sizing: border-box; }
textarea.form-input { resize: vertical; }
.input-md     { height: 44px; }
.hidden       { display: none !important; }

/* Chat bubble styles */
.chat-msg-user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px 12px 4px 12px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 0.9rem;
}
.chat-msg-assistant {
    align-self: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 12px 12px 12px 4px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 0.9rem;
    line-height: 1.6;
}
.chat-msg-assistant--wide { max-width: 90%; }
.chat-msg-synthesis {
    align-self: stretch;
    background: var(--surface);
    border: 2px solid var(--accent);
    padding: 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
}
.chat-agent-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.chat-synthesis-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.chat-token-info {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.chat-badge {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}
.chat-src-toggle { margin-top: 8px; font-size: 0.8rem; }
.chat-src-btn { font-size: 0.75rem; padding: 2px 8px; }
.chat-src-list { display: none; margin-top: 4px; color: var(--text-muted); font-size: 0.8rem; }

/* Markdown rendering helpers */
.md-heading { margin-top: 1rem; margin-bottom: 0.25rem; }
.md-list-item { margin-left: 1.5rem; }

/* Layout component classes */
.stat-value { font-size: 1.3rem; }
.btn-inline-sm { padding: 4px 10px; }
.btn-inline-md { padding: 6px 14px; }
.btn-inline-lg { padding: 6px 16px; }
.text-error { color: #ef4444; }
.text-accent { color: var(--accent); }
.cursor-pointer { cursor: pointer; }
.empty-placeholder { padding: 2rem 1rem; border: 1px dashed var(--border-color, var(--border)); border-radius: 8px; }
.empty-placeholder--sm { padding: 1.5rem 1rem; font-size: 0.9rem; border: 1px dashed var(--border-color, var(--border)); border-radius: 8px; }
.empty-msg { padding: 2rem 1rem; font-size: 0.9rem; }
.doc-row-border { border: 1px solid var(--border-color, var(--border)); border-radius: 8px; margin-bottom: 8px; }
.section-gap { margin-top: 0.75rem; }
.pre-code { background: var(--bg-color, var(--bg)); border: 1px solid var(--border-color, var(--border)); border-radius: 6px; padding: 10px; white-space: pre-wrap; word-wrap: break-word; font-size: 0.85rem; max-height: 300px; overflow-y: auto; margin: 0; }
.pre-code--lg { border-radius: 8px; padding: 12px; font-size: 0.8rem; max-height: 400px; overflow-x: auto; }
.result-panel { padding: 16px; background: var(--bg, var(--bg-color)); border: 1px solid var(--border, var(--border-color)); border-radius: 8px; }
.font-mono { font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace; }
.leading-relaxed { line-height: 1.6; }
.resize-y { resize: vertical; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.col-span-2 { grid-column: span 2; }
.chat-actions { margin-top: 10px; display: flex; gap: 8px; }
.fw-400 { font-weight: 400; }
.mt-xs { margin-top: 4px; }
.mr-xs { margin-right: 4px; }
.mb-xs { margin-bottom: 4px; }
.m-0 { margin: 0; }
.mb-lg { margin-bottom: 1.5rem; }
.d-none        { display: none; }
.inline        { display: inline; }
.grid-2        { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-3        { display: grid; grid-template-columns: repeat(3, 1fr); }
.scroll-y-300  { max-height: 300px; overflow-y: auto; }
.scroll-y-400  { max-height: 400px; overflow-y: auto; }
.scroll-y-500  { max-height: 500px; overflow-y: auto; }
.text-success  { color: #4ade80; }
.text-warning  { color: #ff9800; }
.text-dim      { color: var(--text-dim); }
.word-break-all { word-break: break-all; }
.opacity-70    { opacity: 0.7; }
.p-sm          { padding: 8px; }
.p-lg          { padding: 24px; }
.text-right    { text-align: right; }

/* === Skip Link === */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -999;
}

.skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text);
    z-index: 10000;
    font-size: 0.875rem;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
