/* DeltaGlint - Editorial Design System */
/* 
 * Emotional Tone:
 * DeltaGlint feels like opening a confidential research memo in a private fund's library.
 * It's the quiet confidence of premium print journalism—The Economist, not Medium.
 * Dark, warm, intelligent. A tool you open deliberately, not a site you browse casually.
 * Every interaction is intentional. Every element has purpose. Nothing is decorative.
 */

:root {
    /* Typography - Editorial personality */
    /* Headings: Serif for authority (like print magazines) */
    --font-heading: 'Crimson Text', 'Georgia', serif;
    /* Body: Refined sans-serif with character */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* UI: Clean, minimal */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Font sizes - Print-inspired hierarchy */
    --font-size-xl: 30px;
    --font-size-lg: 20px;
    --font-size-body: 15px;
    --font-size-sm: 13px;
    --font-size-xs: 11px;
    --font-size-label: 12px;
    
    /* Color System - Dark base with warm intelligent accent */
    /* Base: Deep charcoal, not pure black (warmer, more editorial) */
    --color-base: #0f0f0f;
    --color-base-alt: #1a1a1a;
    
    /* Surface: Slightly lighter than base for depth */
    --color-surface: #151515;
    --color-surface-alt: #1f1f1f;
    
    /* Background: Dark, warm tone */
    --color-bg: #0f0f0f;
    --color-bg-alt: #151515;
    
    /* Borders: Subtle, warm dark */
    --color-border: #2a2a2a;
    --color-border-subtle: #252525;
    
    /* Text: Warm light tones on dark */
    --color-text-primary: #e8e8e8;
    --color-text-secondary: #b8b8b8;
    --color-text-muted: #888888;
    
    /* Accent: Warm, intelligent (amber/bronze tone) */
    --color-accent: #d4a574;
    --color-accent-subtle: #b8956a;
    --color-accent-hover: #e8b888;
    
    /* Status: Muted, warm tones */
    --color-error: #c49a7a;
    --color-error-bg: #2a1f1a;
    --color-success: #9ab89a;
    --color-success-bg: #1f2a1f;
    
    /* Interactive: Accent color, not generic */
    --color-button: var(--color-accent);
    --color-button-hover: var(--color-accent-hover);
    --color-button-text: var(--color-base);
    
    /* Spacing - Print-inspired, generous */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 32px;
    --space-lg: 48px;
    --space-xl: 80px;
    
    /* Layout constraints - Print column width */
    --content-width: 640px;
    --content-width-wide: 900px;
    
    /* Typography spacing - Editorial rhythm */
    --line-height-tight: 1.3;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.75;
    
    /* Letter spacing - Natural, not tight */
    --letter-spacing-tight: -0.01em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.02em;
}

/* Typography System - Editorial personality */
/* 
 * Headings: Serif (Crimson Text) for authority, like print magazines
 * Body: Inter for clarity and readability
 * Weights: 400 (regular), 500 (medium), 600 (semibold) only
 * Letter spacing: Natural, not tight
 * Note: Crimson Text font loaded via link tag in HTML
 */

html {
    font-feature-settings: 'liga' 1, 'calt' 1, 'kern' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    margin: 0;
    padding: 0;
    letter-spacing: var(--letter-spacing-normal);
}

/* Headings use serif for editorial authority */
h1, h2, h3, h4, h5, h6,
.hero-headline,
.page-title,
.theses-page-title,
.app-card-title {
    font-family: var(--font-heading);
    font-weight: 400;
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text-primary);
}

/* Login Page - Two Column Layout */
.auth-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .auth-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Hero Section - Dark, editorial, print-inspired */
.auth-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
    background: var(--color-bg);
    position: relative;
    border-right: 1px solid var(--color-border);
}

.auth-hero-content {
    text-align: left;
    max-width: 520px;
    position: relative;
}

/* Brand - minimal, no decoration */
.hero-brand {
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-brand-logo {
    height: 20px;
    width: auto;
    opacity: 1;
    filter: invert(1) brightness(0.7);
}

.hero-brand-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: var(--letter-spacing-tight);
}

/* Headline - Editorial serif, confident */
.hero-headline {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    font-weight: 400;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-md);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
}

/* Subheadline - supporting, not competing */
.hero-subheadline {
    font-size: var(--font-size-body);
    font-weight: 400;
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-sm);
    line-height: var(--line-height-relaxed);
}

/* Tagline - minimal, no italic */
.hero-tagline {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-lg);
    letter-spacing: var(--letter-spacing-normal);
}

/* CTA Button - restrained, no transform */
.hero-cta {
    margin-bottom: 0;
    margin-top: var(--space-lg);
}

.btn-cta-primary {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
    font-weight: 500;
    color: var(--color-button-text);
    background: var(--color-button);
    border: 1px solid var(--color-button);
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.15s ease;
    letter-spacing: var(--letter-spacing-normal);
    text-decoration: none;
}

.btn-cta-primary:hover {
    background: var(--color-button-hover);
    border-color: var(--color-button-hover);
    text-decoration: none;
    color: var(--color-button-text);
}

/* Hero footnote - single line, minimal */
.hero-footnote {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    margin: 0;
    letter-spacing: 0.01em;
}

/* Form Column - Dark surface, depth */
.auth-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
}

.auth-card .auth-form-title,
.auth-card .auth-label {
    color: var(--color-text-primary);
}

.auth-card .auth-input {
    background: var(--color-bg-alt);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

.auth-card .auth-input::placeholder {
    color: var(--color-text-muted);
}

.auth-card .auth-input:focus {
    background: var(--color-bg-alt);
    border-color: var(--color-accent);
    outline: none;
}

.auth-card .auth-button {
    background: var(--color-button);
    color: var(--color-button-text);
    border: 1px solid var(--color-button);
}

.auth-card .auth-button:hover {
    background: var(--color-button-hover);
    border-color: var(--color-button-hover);
}

@media (max-width: 899px) {
    .auth-hero {
        min-height: auto;
        padding: var(--space-lg) var(--space-md);
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
    
    .hero-brand {
        margin-bottom: var(--space-md);
    }
    
    .hero-headline {
        font-size: 24px;
    }
    
    .hero-subheadline {
        font-size: var(--font-size-body);
        margin-bottom: var(--space-md);
    }
    
    .hero-cta {
        margin-bottom: var(--space-md);
    }
    
    .auth-card {
        padding: var(--space-lg) var(--space-md);
        border-left: none;
        border-top: none;
    }
}

.auth-card-body {
    width: 100%;
    max-width: 400px;
}

.auth-form-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-lg);
    letter-spacing: var(--letter-spacing-tight);
}


/* Form Elements - Restrained, clear */
.auth-form-group {
    margin-bottom: var(--space-md);
}

.auth-label {
    display: block;
    font-size: var(--font-size-label);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: none;
    letter-spacing: var(--letter-spacing-normal);
    margin-bottom: var(--space-xs);
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
    font-weight: 400;
    color: var(--color-text-primary);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 0;
    transition: border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: var(--color-bg-alt);
    box-shadow: none;
}

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

/* Button - Restrained, no transform */
.auth-button {
    width: 100%;
    padding: 12px 20px;
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
    font-weight: 500;
    color: var(--color-button-text);
    background: var(--color-button);
    border: 1px solid var(--color-button);
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    text-transform: none;
    letter-spacing: var(--letter-spacing-normal);
    margin-top: var(--space-xs);
}

.auth-button:hover {
    background: var(--color-button-hover);
    border-color: var(--color-button-hover);
}

.auth-button:active {
    background: var(--color-button);
}

/* Access link - minimal, allows but doesn't invite */
.auth-access-link {
    text-align: center;
    margin-top: 16px;
}

.auth-access-link a {
    font-size: 12px;
    color: #666666;
    text-decoration: none;
    opacity: 0.4;
}

.auth-access-link a:hover {
    opacity: 0.7;
}

.auth-button:focus {
    outline: 2px solid #374151;
    outline-offset: 2px;
}

/* Alerts - Muted, not alarming */
.auth-alert {
    padding: 12px 16px;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-sm);
    border: 1px solid;
    border-radius: 0;
    background: transparent;
}

.auth-alert-error {
    color: var(--color-error);
    border-color: var(--color-error);
    background: var(--color-error-bg);
}

.auth-alert-success {
    color: var(--color-success);
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

/* Application Pages - Dark, editorial */
.app-container {
    min-height: 100vh;
    background: var(--color-bg);
}

.app-navbar {
    background: var(--color-base-alt);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) 0;
    margin-bottom: 0;
}

.app-navbar-brand {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
    text-decoration: none;
    letter-spacing: var(--letter-spacing-tight);
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-navbar-brand-logo {
    height: 20px;
    width: auto;
    opacity: 1;
    filter: invert(1) brightness(0.7);
}

.app-navbar-brand:hover {
    text-decoration: none;
}

.app-navbar-link {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.15s ease;
}

.app-navbar-link:hover {
    color: var(--color-text-primary);
    text-decoration: none;
}

/* Theme toggle - hidden in minimalist mode */
.theme-toggle {
    display: none;
}

.app-content {
    padding: var(--space-lg) 0 var(--space-xl);
    margin-top: 0;
    background: var(--color-bg);
    min-height: calc(100vh - 65px);
}

.app-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0;
}

.app-card-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    background: transparent;
}

.app-card-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: 400;
    color: var(--color-text-primary);
    margin: 0;
    letter-spacing: var(--letter-spacing-tight);
}

.app-card-body {
    padding: var(--space-md);
}

/* Form controls in app - Quiet System */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: var(--font-size-label);
    font-weight: 500;
    color: #666666;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 8px;
}

.form-control {
    display: block;
    width: 100%;
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    color: var(--color-text-primary);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 12px 14px;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--color-accent);
    background: var(--color-surface-alt);
    box-shadow: 0 0 0 1px var(--color-accent);
    outline: none;
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-weight: 500;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: var(--font-size-sm);
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--color-button);
    color: var(--color-button-text);
    font-weight: 500;
    padding: 10px 20px;
    letter-spacing: var(--letter-spacing-normal);
    border: 1px solid var(--color-button);
}

.btn-primary:hover {
    background: var(--color-button-hover);
    border-color: var(--color-button-hover);
    color: var(--color-button-text);
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    font-weight: 400;
    transition: color 0.2s ease, border-color 0.2s ease;
}

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

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

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

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

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

.btn-danger {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

.btn-danger:hover {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error);
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--font-size-small);
}

/* Outline buttons (used across app pages) */
.btn-outline-primary,
.btn-outline-secondary {
    background: transparent;
    border: 1px solid #eeeeee;
    color: #111111;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    background: #fafafa;
    border-color: #e5e5e5;
    color: #111111;
}

[data-theme="dark"] .btn-outline-primary,
[data-theme="dark"] .btn-outline-secondary {
    border-color: #e5e5e5;
}

/* List groups - Quiet System */
.list-group {
    list-style: none;
    padding: 0 2em;
    margin: 0;
}

.list-group-flush .list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0;
}

.list-group-flush .list-group-item:first-child {
    border-top: none;
}

.list-group-flush .list-group-item:last-child {
    border-bottom: none;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    padding: var(--space-md) 0;
    display: block;
    text-decoration: none;
    color: var(--color-text-primary);
    background: transparent;
    transition: opacity 0.15s ease;
}

.list-group-item-action {
    cursor: pointer;
}

.list-group-item-action:hover {
    opacity: 0.7;
    text-decoration: none;
    color: var(--color-text-primary);
}

.list-group-item.active {
    background: transparent;
    border-color: var(--color-accent);
    color: var(--color-text-primary);
}

.list-group-item.active:hover {
    background: transparent;
    opacity: 1;
}

.list-group-item:first-child {
    border-top: 1px solid var(--color-border);
}

.list-group-item:last-child {
    border-bottom: 1px solid var(--color-border);
}

/* Brief list item content spacing */
.list-group-item strong {
    display: block;
    margin-bottom: 6px;
    line-height: 1.3;
}

.list-group-item small.text-muted {
    display: block;
    margin-top: 2px;
}

/* Badges - Restrained, muted */
.badge {
    font-size: var(--font-size-xs);
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 0;
    text-transform: none;
    letter-spacing: var(--letter-spacing-normal);
    display: inline-block;
}

.bg-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

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

.bg-danger {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

.bg-info {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.bg-warning {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

/* Nav tabs - Quiet System */
.nav-tabs {
    border-bottom: 1px solid #E5E7EB;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    color: #6B7280;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #1F2937;
    background: transparent;
    border-bottom: 2px solid #0E1620;
}

/* Minimal Grid System - Centered single column */
.container {
    width: 100%;
    max-width: var(--content-width-wide);
    margin: 0 auto;
    padding: 0 24px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col-md-4,
.col-md-8 {
    padding: 0 12px;
    flex: 0 0 100%;
}

@media (min-width: 768px) {
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .col-md-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* Spacing between columns on mobile */
@media (max-width: 767px) {
    .col-md-8 {
        margin-top: var(--space-md);
    }
}

/* Utility Classes */
.text-muted {
    color: #888888 !important;
}

.text-end {
    text-align: right;
}

.small {
    font-size: var(--font-size-small);
}

.mb-2 {
    margin-bottom: 12px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mx-2 {
    margin-left: 8px;
    margin-right: 8px;
}

.align-items-start {
    align-items: flex-start;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.mb-3 {
    margin-bottom: 16px;
}

.mb-4 {
    margin-bottom: 24px;
}

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.w-100 {
    width: 100%;
}

.gap-2 {
    gap: 12px;
}

/* Alerts for app pages - Muted, not alarming */
.alert {
    padding: 12px 16px;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-sm);
    border: 1px solid;
    border-radius: 0;
    background: transparent;
}

.alert-danger {
    color: var(--color-error);
    border-color: var(--color-error);
    background: var(--color-error-bg);
}

.alert-success {
    color: var(--color-success);
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.alert-info {
    color: #1E40AF;
    border-color: #93C5FD;
    background: #EFF6FF;
}

.alert-warning {
    color: #92400E;
    border-color: #FCD34D;
    background: #FFFBEB;
}

/* Empty State - Restrained */
.empty-state {
    text-align: left;
    padding: var(--space-lg) var(--space-md) !important;
    color: var(--color-text-secondary);
}

.empty-state-title {
    display: block;
    font-size: var(--font-size-body);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.empty-state-hint {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Dashboard - Last runs */
.runs-list .run-item {
    padding: var(--space-md);
    border-bottom: 1px solid #e5e5e5;
    background: #ffffff;
}

.runs-list .run-item:last-child {
    border-bottom: none;
}

.run-item-top {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    align-items: flex-start;
}

.run-item-left {
    min-width: 0;
    flex: 1;
}

.run-title {
    font-size: var(--font-size-body);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
    margin-bottom: 4px;
    color: #111111;
}

.run-time {
    font-size: var(--font-size-sm);
    color: #888888;
}

.run-item-right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.run-cost {
    font-size: var(--font-size-sm);
    color: #888888;
}

.run-snippet {
    margin-top: var(--space-sm);
    line-height: 1.65;
    font-size: var(--font-size-sm);
    color: #666666;
}

.run-actions {
    margin-top: var(--space-sm);
}

.runs-list .run-item:hover {
    background: #ffffff;
}

/* Prompt Field */
.prompt-field {
    margin-bottom: 32px;
}

.prompt-field .form-label {
    font-size: 12px;
    letter-spacing: 0;
}

.prompt-textarea {
    min-height: 140px;
    line-height: 1.7;
    padding: 16px 14px;
    font-size: 15px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

.prompt-textarea:focus {
    background: #ffffff;
    border-color: #999999;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}

.prompt-textarea::placeholder {
    color: #999999;
    font-style: normal;
}

/* Form Hints - Whisper, don't speak */
.form-hint {
    display: block;
    margin-top: 8px;
    font-size: var(--font-size-small);
    color: #888888;
    letter-spacing: 0;
    line-height: 1.4;
}

.checkbox-hint {
    margin-left: 28px;
    margin-top: 2px;
    font-size: var(--font-size-label);
}

/* Output type philosophy hint - hidden by default */
.output-philosophy {
    display: none;
}

/* Schedule Row - Human-friendly time display */
.schedule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.schedule-hour {
    width: auto;
    min-width: 90px;
    flex-shrink: 0;
    cursor: pointer;
}

.schedule-day {
    width: auto;
    min-width: 120px;
    flex-shrink: 0;
}

.schedule-day-num {
    width: auto;
    min-width: 70px;
    flex-shrink: 0;
}

.schedule-separator {
    color: var(--color-text-muted);
    font-weight: 400;
    flex-shrink: 0;
    font-size: var(--font-size-sm);
}

.schedule-tz {
    width: auto;
    min-width: 130px;
}

/* Frequency select */
#frequency {
    max-width: 200px;
}

/* Select styling */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888888' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    background-color: var(--color-surface-alt);
}

/* Form Check */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 0;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #0E1620;
    cursor: pointer;
}

.form-check-label {
    font-size: 14px;
    color: #111111;
    line-height: 1.4;
    cursor: pointer;
}

/* Form actions */
.form-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
    flex-wrap: wrap;
}

.form-actions .btn {
    margin-bottom: 8px;
}

/* Page Header */
.page-header{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: var(--space-lg, 48px);
    margin-bottom: 32px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    font-weight: 400;
    color: var(--color-text-primary);
    margin: 0;
    letter-spacing: var(--letter-spacing-tight);
}

.page-back-link {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.page-back-link:hover {
    color: var(--color-text-primary);
    text-decoration: none;
}

/* Run Details */
.run-meta {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
}

.run-meta strong {
    color: #374151;
    font-weight: 500;
}

.run-section-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #EAECEF;
}

.run-section-title:first-of-type {
    margin-top: 0;
}

/* Results list styling */
.results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.results-list li {
    padding: 12px 0;
    border-bottom: 1px solid #EAECEF;
}

.results-list li:last-child {
    border-bottom: none;
}

.results-list a {
    color: #2D3748;
    text-decoration: none;
    font-weight: 500;
}

.results-list a:hover {
    color: #0E1620;
}

.results-list small {
    display: block;
    margin-top: 4px;
    color: #6B7280;
    font-size: 13px;
    line-height: 1.5;
}

/* Request Access Button - Minimal, inviting */
/* Hero actions container */
.auth-hero-actions {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Examples link on hero */
.examples-hero-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: #888888;
    text-decoration: none;
    padding: 8px 0;
    letter-spacing: 0.01em;
    transition: color 0.15s ease;
}

.examples-hero-link:hover {
    color: #111111;
}

.request-access-btn {
    margin-top: 0;
    padding: 12px 28px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    color: #F6F6F6;
    background: transparent;
    border: 1px solid rgba(246, 246, 246, 0.3);
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    letter-spacing: 0.02em;
}

.request-access-btn:hover {
    background: rgba(246, 246, 246, 0.1);
    border-color: rgba(246, 246, 246, 0.5);
}

.request-access-btn:active {
    background: rgba(246, 246, 246, 0.15);
}

/* Modal Overlay - restrained */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 15, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--space-md);
    backdrop-filter: blur(2px);
}

.modal-overlay.modal-open {
    display: flex;
}

.modal-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0;
    width: 100%;
    max-width: 400px;
    padding: var(--space-lg);
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #888888;
    cursor: pointer;
    line-height: 1;
    border-radius: 2px;
}

.modal-close:hover {
    color: #666666;
    background: rgba(0, 0, 0, 0.05);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-xs);
    letter-spacing: var(--letter-spacing-tight);
}

.modal-desc {
    font-size: var(--font-size-body);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-md);
    line-height: var(--line-height-normal);
}

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

.modal-message {
    display: none;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    border-radius: 2px;
    border: 1px solid;
}

.modal-message.modal-message-visible {
    display: block;
}

.modal-message-success {
    color: var(--color-success);
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.modal-message-error {
    color: var(--color-error);
    border-color: var(--color-error);
    background: var(--color-error-bg);
}

/* ============================================
   PUBLIC EXAMPLES PAGES
   Calm, finite, library-like presentation
   ============================================ */

/* Examples Page Layout */
.examples-page {
    min-height: 100vh;
    background: #ffffff;
}

.examples-header {
    background: #0a0a0a;
    padding: 48px 0;
    text-align: center;
}

.examples-title {
    font-family: 'Inter', var(--font-ui);
    font-size: 28px;
    font-weight: 600;
    color: #111111;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.examples-subtitle {
    font-size: 15px;
    color: #888888;
    margin: 0;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.examples-content {
    padding: 48px 24px 64px;
    max-width: 1000px;
}

/* Examples Grid - Fixed, finite layout */
.examples-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
}

/* Example Card */
.example-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease;
}

.example-card:hover {
    border-color: #eeeeee;
}

[data-theme="dark"] .example-card:hover {
    border-color: #888888;
}

.example-card-header {
    margin-bottom: 16px;
}

.example-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.example-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Domain badge colors - Minimalist, all neutral */
.badge-finance,
.badge-family,
.badge-sports,
.badge-career,
.badge-tech,
.badge-health,
.badge-default {
    background: #f0f0f0;
    color: #666666;
}

.badge-frequency {
    background: transparent;
    color: #888888;
    border: 1px solid #e0e0e0;
}

.example-card-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 12px;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.example-card-title a {
    color: #111111;
    text-decoration: none;
}

.example-card-title a:hover {
    color: #666666;
}

.example-card-preview {
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
    margin: 0 0 20px;
    flex-grow: 1;
}

.example-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #eeeeee;
}

.example-date {
    font-size: 12px;
    color: #888888;
}

.example-link {
    font-size: 13px;
    font-weight: 500;
    color: #666666;
    text-decoration: none;
}

.example-link:hover {
    color: #111111;
}

/* Examples Page CTA */
.examples-cta {
    margin-top: 56px;
    text-align: center;
    padding: 40px 24px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
}

.examples-cta-text {
    font-size: 16px;
    color: #666666;
    margin: 0 0 20px;
}

/* Examples Footer */
.examples-footer {
    padding: 32px 24px;
    text-align: center;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

.examples-footer p {
    font-size: 13px;
    color: #888888;
    margin: 0;
}

/* Empty state */
.examples-empty {
    text-align: center;
    padding: 64px 24px;
    color: #666666;
}

/* ============================================
   EXAMPLE DETAIL PAGE
   ============================================ */

.example-detail-page {
    min-height: 100vh;
    background: #ffffff;
}

.example-detail-content {
    padding: 32px 24px 64px;
    max-width: 800px;
}

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

.example-back-link {
    font-size: 14px;
    color: #666666;
    text-decoration: none;
}

.example-back-link:hover {
    color: #111111;
}

/* Read-only label - subtle but clear */
.example-readonly-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #888888;
    padding: 6px 12px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.readonly-indicator {
    width: 6px;
    height: 6px;
    background: #888888;
    border-radius: 50%;
    opacity: 0.6;
}

/* Example Detail Card */
.example-detail-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
}

.example-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
    flex-wrap: wrap;
    gap: 12px;
}

.example-execution-date {
    font-size: 13px;
    color: #888888;
}

.example-detail-title {
    font-size: 22px;
    font-weight: 600;
    color: #111111;
    margin: 0;
    padding: 28px 28px 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.example-detail-body {
    padding: 24px 28px 32px;
    font-size: 15px;
    line-height: 1.7;
    color: #111111;
}

/* Markdown content styling */
.example-detail-body h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
    letter-spacing: -0.01em;
}

.example-detail-body h1:first-child {
    margin-top: 0;
}

.example-detail-body h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: #111111;
}

.example-detail-body h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 24px 0 10px;
    color: #111111;
}

.example-detail-body h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 20px 0 8px;
    color: #666666;
}

.example-detail-body p {
    margin: 0 0 16px;
}

.example-detail-body li {
    margin-bottom: 6px;
}

.example-detail-body hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 28px 0;
}

.example-detail-body a {
    color: #111111;
    text-decoration: underline;
    text-decoration-color: #e5e5e5;
    text-underline-offset: 2px;
}

.example-detail-body a:hover {
    text-decoration-color: #666666;
}

.example-detail-body strong {
    font-weight: 600;
    color: #111111;
}

.example-detail-body em {
    font-style: italic;
}

/* Simple table styling */
.example-detail-body tr {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #eeeeee;
}

.example-detail-body td {
    display: inline;
}

/* Example Detail CTA */
.example-detail-cta {
    margin-top: 40px;
}

.example-cta-box {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    padding: 32px;
    text-align: center;
}

.example-cta-title {
    font-size: 18px;
    font-weight: 600;
    color: #111111;
    margin: 0 0 12px;
}

.example-cta-text {
    font-size: 14px;
    color: #666666;
    margin: 0 0 24px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.example-detail-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eeeeee;
}

/* ============================================
   NEW RUN NOTIFICATIONS - Ritual UI
   See → click → consume → disappearance
   ============================================ */

/* Navbar "X new run(s)" indicator - muted, not bright */
.nav-newrun {
    font-size: var(--font-size-xs);
    font-weight: 400;
    color: var(--color-text-secondary);
    letter-spacing: var(--letter-spacing-normal);
}

/* Thesis NEW dot - warm accent indicator */
.thesis-new-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--color-accent);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* NEW badge - warm accent */
.badge-new {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 400;
    text-transform: none;
    letter-spacing: var(--letter-spacing-normal);
    padding: 2px 6px;
    border-radius: 0;
    background: var(--color-accent);
    color: var(--color-base);
    border: 1px solid var(--color-accent);
    margin-left: 6px;
    vertical-align: middle;
}

/* Run item NEW highlight - subtle accent border */
.run-item-new {
    background: var(--color-surface) !important;
    border-left: 2px solid var(--color-accent) !important;
}

.run-item-new .run-title {
    font-weight: 600;
}

/* ================================
   Phase 4: Polish & Animations
   ================================ */

/* Subtle fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply fade-in to main content */
.app-content {
    animation: fadeIn 0.3s ease-out;
}

/* Card hover effect - subtle depth */
.app-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Link underline animation */
.app-navbar-link {
    position: relative;
}

.app-navbar-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.2s ease;
}

.app-navbar-link:hover::after {
    width: 100%;
}

/* Button press effect */
.btn:active {
    transform: translateY(1px);
}

/* Smooth list item transitions */
.list-group-item {
    transition: opacity 0.15s ease, background 0.15s ease;
}

/* Focus states for accessibility */
.btn:focus-visible,
.form-control:focus-visible {
    outline: 2px solid #888888;
    outline-offset: 2px;
}

/* Improved scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
}

::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888888;
}

/* ================================
   Single-Column Theses Layout
   ================================ */

.theses-container {
    max-width: 720px;
    margin: 0 auto;
}

.theses-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: var(--space-lg, 48px);
    margin-bottom: var(--space-lg, 48px);
}

.theses-page-title {
    font-size: var(--font-size-xl, 28px);
    font-weight: 600;
    color: #111111;
    margin: 0;
    letter-spacing: -0.02em;
}

.theses-new-link {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.theses-new-link:hover {
    color: var(--color-text-primary);
    text-decoration: none;
}

.thesis-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: border-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.thesis-card:hover {
    box-shadow: none;
    border-color: var(--color-accent);
    text-decoration: none;
}

.thesis-card-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-xs) 0;
    letter-spacing: var(--letter-spacing-tight);
}

.thesis-card-meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.thesis-card-snippet {
    font-size: var(--font-size-body);
    color: var(--color-text-secondary);
    margin: var(--space-sm) 0;
    line-height: var(--line-height-normal);
    font-style: normal;
}

.thesis-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-sm);
}

.thesis-card-cta {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-text-secondary);
    transition: color 0.15s ease;
}

.thesis-card:hover .thesis-card-cta {
    color: var(--color-text-primary);
}

/* Empty state for no runs */
.thesis-card-no-runs {
    font-size: var(--font-size-sm, 13px);
    color: #888888;
    margin-top: 12px;
    font-style: italic;
}

/* Create new thesis button */
.theses-create {
    text-align: center;
    margin-top: var(--space-lg, 48px);
}

.theses-create a {
    display: inline-block;
    font-size: var(--font-size-body, 15px);
    font-weight: 500;
    color: #666666;
    text-decoration: none;
    padding: 12px 24px;
    border: 1px dashed #e5e5e5;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.theses-create a:hover {
    color: #111111;
    border-color: #888888;
    background: #ffffff;
}

/* Empty state when no theses */
.theses-empty {
    text-align: left;
    padding: var(--space-xl) var(--space-md);
    color: var(--color-text-muted);
}

.theses-empty-title {
    font-size: var(--font-size-lg);
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.theses-empty-hint {
    font-size: var(--font-size-body);
    margin-bottom: var(--space-md);
}

/* ================================
   Decision Feed Layout
   Two-panel: Sidebar + Feed
   ================================ */

.decision-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--space-lg);
    max-width: 1000px;
    margin: 0 auto;
    padding-top: var(--space-lg);
    min-height: calc(100vh - 150px);
}

/* Thesis Sidebar */
.thesis-sidebar {
    position: sticky;
    top: var(--space-lg);
    height: fit-content;
    padding-right: var(--space-md);
    border-right: 1px solid var(--color-border-subtle);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-subtle);
}

.sidebar-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-new-link {
    font-size: var(--font-size-lg);
    font-weight: 300;
    color: var(--color-text-muted);
    text-decoration: none;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.15s ease;
}

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

.sidebar-empty {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-style: italic;
    padding: var(--space-sm) 0;
}

/* Thesis Filter Links - "All" filter (simple link) */
.thesis-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 2px;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 0;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
}

.thesis-filter:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-alt);
}

.thesis-filter.active {
    color: var(--color-text-primary);
    font-weight: 500;
    border-left-color: var(--color-accent);
    background: var(--color-surface-alt);
}

/* Thesis Filter Row - with contextual menu */
.thesis-filter-row {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
    z-index: 1;
}

.thesis-filter-row:hover {
    background: var(--color-surface-alt);
}

.thesis-filter-row.menu-open {
    z-index: 100;
}

.thesis-filter-row.active {
    border-left-color: var(--color-accent);
    background: var(--color-surface-alt);
}

.thesis-filter-row.active .thesis-filter-link {
    color: var(--color-text-primary);
    font-weight: 500;
}

.thesis-filter-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 8px 10px 12px;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thesis-filter-row:hover .thesis-filter-link {
    color: var(--color-text-primary);
}

/* Contextual menu button */
.thesis-menu-btn {
    opacity: 0;
    padding: 4px 10px;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s ease, color 0.15s ease;
    line-height: 1;
    letter-spacing: 1px;
}

.thesis-filter-row:hover .thesis-menu-btn,
.thesis-filter-row.menu-open .thesis-menu-btn {
    opacity: 1;
}

.thesis-menu-btn:hover {
    color: var(--color-text-primary);
}

/* Dropdown menu */
.thesis-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 140px;
    background: var(--color-base);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.thesis-filter-row.menu-open .thesis-menu-dropdown {
    display: block;
}

.thesis-menu-item {
    display: block;
    padding: 12px 16px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    background: var(--color-base);
    transition: all 0.1s ease;
}

.thesis-menu-item:hover {
    background: var(--color-surface-alt);
    color: var(--color-text-primary);
}

/* Stale state for rows */
.thesis-filter-stale {
    opacity: 0.5;
}

.thesis-filter-stale:hover {
    opacity: 0.8;
}

.thesis-filter-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Decision Feed Main Area */
.decision-feed {
    min-width: 0; /* Prevent grid blowout */
}

.feed-context {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-subtle);
}

.feed-empty {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}

.feed-empty-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.feed-empty-hint {
    font-size: var(--font-size-body);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: var(--line-height-relaxed);
}

/* Feed Run Cards */
.feed-run {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

.feed-run:hover {
    border-color: var(--color-accent);
}

.feed-run-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xs);
}

.feed-run-thesis {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.feed-run-meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.feed-run-status {
    margin-bottom: var(--space-sm);
}

.feed-run-diff {
    font-size: var(--font-size-sm);
    font-weight: 400;
    padding: 3px 8px;
    border-radius: 0;
}

.feed-run-diff.has-diff {
    background: rgba(212, 165, 116, 0.15);
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.feed-run-diff.no-diff {
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.feed-run-snippet {
    font-size: var(--font-size-body);
    color: var(--color-text-secondary);
    line-height: var(--line-height-normal);
    margin-bottom: var(--space-sm);
}

.feed-run-actions {
    display: flex;
    gap: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border-subtle);
}

.feed-run-link {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

.feed-run-link-secondary {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.feed-run-link-secondary:hover {
    color: var(--color-text-secondary);
}

/* Recency-based Visual Fading */
.feed-run.run-latest {
    /* Full contrast - most prominent */
    opacity: 1;
    background: var(--color-surface);
    border-color: var(--color-border);
}

.feed-run.run-recent {
    /* Slightly faded */
    opacity: 0.85;
    background: var(--color-surface);
}

.feed-run.run-recent .feed-run-thesis {
    color: var(--color-text-secondary);
}

.feed-run.run-older {
    /* More faded - still readable but less prominent */
    opacity: 0.65;
    background: var(--color-bg-alt);
}

.feed-run.run-older .feed-run-thesis {
    color: var(--color-text-secondary);
}

.feed-run.run-older .feed-run-snippet {
    color: var(--color-text-muted);
}

/* New run highlight - overrides recency fading */
.feed-run.feed-run-new {
    opacity: 1;
    border-left: 3px solid var(--color-accent);
    background: var(--color-surface);
}

/* Responsive: Mobile Layout */
@media (max-width: 768px) {
    .decision-layout {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        padding-top: var(--space-md);
    }
    
    .thesis-sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--color-border-subtle);
        padding-right: 0;
        padding-bottom: var(--space-md);
        margin-bottom: var(--space-sm);
    }
    
    .sidebar-header {
        display: none;
    }
    
    /* Horizontal filter bar on mobile */
    .thesis-sidebar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .thesis-filter {
        padding: 8px 14px;
        margin-bottom: 0;
        border-left: none;
        border: 1px solid var(--color-border);
        border-radius: 0;
    }
    
    .thesis-filter.active {
        border-color: var(--color-accent);
        background: var(--color-surface-alt);
    }
    
    /* Thesis filter rows on mobile - pill style */
    .thesis-filter-row {
        border-left: none;
        border: 1px solid var(--color-border);
        margin-bottom: 0;
    }
    
    .thesis-filter-row.active {
        border-color: var(--color-accent);
    }
    
    .thesis-filter-link {
        padding: 8px 12px;
    }
    
    /* Always show menu button on mobile (touch devices) */
    .thesis-menu-btn {
        opacity: 0.6;
        padding: 8px 10px;
    }
    
    /* Dropdown positioning on mobile */
    .thesis-menu-dropdown {
        right: auto;
        left: 0;
    }
    
    .sidebar-empty {
        width: 100%;
        text-align: center;
    }
    
    .feed-run-header {
        flex-direction: column;
        gap: 4px;
    }
    
    .feed-run-actions {
        flex-direction: column;
        gap: var(--space-xs);
    }
}

/* ================================
   Thesis Form - New Design
   ================================ */

/* Numbered form labels */
.form-label-numbered {
    font-size: var(--font-size-body, 15px);
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}

/* Frequency radio button group */
.frequency-radio-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.frequency-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.frequency-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.frequency-radio-label {
    display: inline-block;
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-text-secondary);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 0;
    transition: all 0.2s ease;
}

.frequency-radio input[type="radio"]:checked + .frequency-radio-label {
    background: var(--color-button);
    color: var(--color-button-text);
    border-color: var(--color-button);
}

.frequency-radio:hover .frequency-radio-label {
    border-color: var(--color-accent);
}

/* Time horizon radio buttons - same style as frequency */
.horizon-radio-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.horizon-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.horizon-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.horizon-radio-label {
    display: inline-block;
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-text-secondary);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 0;
    transition: all 0.2s ease;
}

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

.horizon-radio:hover .horizon-radio-label {
    border-color: var(--color-accent);
}

/* Schedule selectors */
.schedule-selectors {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-weekly-options,
.schedule-monthly-options {
    margin-top: 0;
}

.schedule-weekly-options select,
.schedule-monthly-options select {
    width: auto;
    min-width: 140px;
}

/* Advanced settings - collapsible */
.advanced-settings {
    margin-top: 32px;
    margin-bottom: 32px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.advanced-settings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    cursor: pointer;
    background: #fafafa;
    list-style: none;
    user-select: none;
}

.advanced-settings-toggle::-webkit-details-marker {
    display: none;
}

.advanced-settings-toggle::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #999999;
    border-bottom: 2px solid #999999;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    margin-right: 4px;
}

.advanced-settings[open] .advanced-settings-toggle::before {
    transform: rotate(45deg);
}

.advanced-settings-label {
    font-size: var(--font-size-sm, 13px);
    font-weight: 500;
    color: #333333;
}

.advanced-settings-optional {
    font-size: var(--font-size-sm, 13px);
    color: #999999;
    font-weight: 400;
}

.advanced-settings-content {
    padding: 20px;
    background: #fafafa;
    border-top: 1px solid #e5e5e5;
}

/* Form intro - framing sentence */
.form-intro {
    margin-bottom: 40px;
    padding-bottom: 0;
    border-bottom: none;
}

.form-intro-title {
    font-size: 15px;
    font-weight: 500;
    color: #666666;
    margin: 0 0 4px 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-intro-subtitle {
    font-size: var(--font-size-sm, 13px);
    color: #888888;
    margin: 0;
}

/* Thesis field - the heart of DeltaGlint */
.thesis-field {
    padding: var(--space-md);
    margin: var(--space-md) 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0;
}

.thesis-field .form-label-numbered {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 16px;
}

.thesis-field .form-control,
.thesis-field .thesis-textarea {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 0;
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text-primary);
    padding: 14px 16px;
    line-height: 1.6;
}

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

.thesis-field .form-control:focus,
.thesis-field .thesis-textarea:focus {
    border-color: var(--color-accent);
    background: var(--color-surface-alt);
    box-shadow: none;
}

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

.thesis-field .form-hint {
    color: var(--color-text-secondary);
    font-size: 13px;
    margin-top: 12px;
}

/* Scheduling settings - collapsible, de-emphasized */
.scheduling-settings {
    margin-top: 32px;
    margin-bottom: 24px;
}

.scheduling-settings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    cursor: pointer;
    list-style: none;
}

.scheduling-settings-toggle::-webkit-details-marker {
    display: none;
}

.scheduling-settings-toggle::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #888888;
    border-bottom: 1.5px solid #888888;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    margin-right: 4px;
}

.scheduling-settings[open] .scheduling-settings-toggle::before {
    transform: rotate(45deg);
}

.scheduling-settings-label {
    font-size: var(--font-size-sm, 13px);
    font-weight: 400;
    color: #888888;
}

.scheduling-settings-content {
    padding: 16px 0;
}

.scheduling-settings-content .frequency-radio-group {
    margin-bottom: 16px;
}

/* Sensitivity slider */
.sensitivity-field {
    margin-bottom: 0;
}

.sensitivity-field .form-label {
    font-size: var(--font-size-sm, 13px);
    font-weight: 500;
    color: #333333;
    margin-bottom: 16px;
}

.sensitivity-slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sensitivity-label-low,
.sensitivity-label-high {
    font-size: var(--font-size-sm, 13px);
    font-weight: 500;
    color: #666666;
    min-width: 36px;
}

.sensitivity-label-low {
    text-align: right;
}

.sensitivity-label-high {
    text-align: left;
}

.sensitivity-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.sensitivity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #111111;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.sensitivity-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #111111;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.sensitivity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.sensitivity-descriptions {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.sensitivity-desc-low,
.sensitivity-desc-high {
    font-size: var(--font-size-xs, 11px);
    color: #888888;
    max-width: 45%;
}

.sensitivity-desc-low {
    text-align: left;
}

.sensitivity-desc-high {
    text-align: right;
}

/* Status toggle switch */
.status-toggle-section {
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-subtle);
}

.status-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.status-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.status-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.status-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--color-text-muted);
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.status-toggle input[type="checkbox"]:checked + .status-toggle-switch::after {
    left: 22px;
    background: var(--color-base);
}

.status-toggle-label {
    font-size: var(--font-size-body);
    font-weight: 500;
    color: var(--color-text-primary);
}

.status-toggle input[type="checkbox"]:not(:checked) ~ .status-toggle-label {
    color: var(--color-text-muted);
}

/* Form actions - dual button layout */
.form-actions-dual {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
}

.form-actions-left {
    flex: 0 0 auto;
}

.form-actions-right {
    display: flex;
    gap: 12px;
}

.btn-link-danger {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.btn-link-danger:hover {
    color: var(--color-error);
    text-decoration: underline;
}

/* Dark mode adjustments for new form elements */
[data-theme="dark"] .frequency-radio input[type="radio"]:checked + .frequency-radio-label {
    background: #ffffff;
    color: #111111;
    border-color: #888888;
}

[data-theme="dark"] .sensitivity-slider {
    background: #e5e5e5;
}

[data-theme="dark"] .sensitivity-slider::-webkit-slider-thumb {
    background: #ffffff;
    border: 2px solid #888888;
}

[data-theme="dark"] .sensitivity-slider::-moz-range-thumb {
    background: #ffffff;
    border: 2px solid #888888;
}

[data-theme="dark"] .advanced-settings-content {
    background: #ffffff;
}

/* Footer */
.app-footer {
    padding: 40px 0;
    margin-top: 40px;
    text-align: center;
    background: var(--color-bg);
}

.app-footer .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-brand {
    font-size: 13px;
    font-weight: 500;
    color: #999999;
}

.footer-sep {
    color: #cccccc;
}

.footer-copy {
    font-size: 13px;
    color: #999999;
}

/* Scheduling section (visible, not collapsed) */
.scheduling-section {
    margin-top: 32px;
}

.scheduling-section .form-label-numbered {
    margin-bottom: 16px;
}

.scheduling-content {
    padding: 0;
}

.scheduling-content .frequency-radio-group {
    margin-bottom: 16px;
}