/* Recalletta - Clean, Modern Design */

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

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #22c55e;
    --error: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation */
.navbar {
    background: #0a1629;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.navbar-brand img {
    height: 36px;
    width: auto;
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.navbar-menu a.active {
    color: var(--primary);
    font-weight: 500;
}

/* Main */
main {
    flex: 1;
}

/* Hero */
.hero {
    text-align: center;
    padding: 1rem 0 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-weight: 700;
    color: var(--text);
}

.hero .lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

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

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

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

.btn-secondary:hover {
    background: var(--bg-card);
}

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

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

/* Features */
.features {
    margin-top: 1rem;
}

.features h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.feature {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.feature h3 {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* How it works */
.how-it-works {
    margin-top: 4rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

.how-it-works h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.steps-vertical {
    max-width: 550px;
    margin: 0 auto;
}

.step-v {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-label {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    min-width: 1.5rem;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-content strong {
    font-size: 1rem;
    color: var(--text);
}

.step-content code {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.step-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Code block */
.code-example {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 600px;
}

.code-example code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Demo GIF */
.demo-gif {
    margin: 0.5rem auto 2rem;
    max-width: 900px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.demo-gif img {
    display: block;
    width: 100%;
    height: auto;
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--success);
    color: #86efac;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg-dark);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Utilities */
.inline-form { display: inline; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Markdown Content Styling */
.markdown-content {
    line-height: 1.7;
    font-size: 0.95rem;
}

.markdown-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    margin-top: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.markdown-content h1:first-child {
    margin-top: 0;
}

.markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.markdown-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-content p {
    margin-bottom: 1rem;
    color: var(--text);
}

.markdown-content em {
    color: var(--text-muted);
    font-style: italic;
}

.markdown-content strong {
    font-weight: 600;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.markdown-content code {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
}

.markdown-content pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-content pre code {
    background: none;
    border: none;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1rem;
    margin-top: 1rem;
    color: var(--text);
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 0 6px 6px 0;
}

.markdown-content blockquote p {
    margin-bottom: 0;
}

.markdown-content a {
    color: var(--primary);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.markdown-content th {
    background: var(--bg-card);
    font-weight: 600;
}

.markdown-content dl {
    margin-bottom: 1rem;
}

.markdown-content dt {
    font-weight: 600;
    margin-top: 0.5rem;
}

.markdown-content dd {
    margin-left: 2rem;
    margin-bottom: 0.5rem;
}

/* API Keys Page Styling */
.section {
    margin-top: 2rem;
}

.section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.create-key-form .form-row {
    display: flex;
    gap: 1rem;
    max-width: 500px;
}

.create-key-form .form-control {
    flex: 1;
}

.new-key-box {
    background: var(--bg-card);
    border: 1px solid var(--success);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.new-key-box h3 {
    color: var(--success);
    margin-bottom: 0.5rem;
}

.key-display {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.key-display code {
    background: var(--bg-dark);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    flex: 1;
    word-break: break-all;
}

.status-active {
    color: var(--success);
}

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

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

/* Feedback Page Styling */
.feedback-section {
    margin-bottom: 3rem;
}

.intro-text {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.feedback-form .form-group {
    margin-bottom: 1.5rem;
}

.feedback-form label {
    display: block;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.required {
    color: var(--error);
}

.feedback-textarea {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 200px;
}

.form-actions {
    display: flex;
    gap: 1rem;
}

.recent-feedback {
    margin-top: 3rem;
}

.recent-feedback h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.feedback-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.feedback-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.feedback-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.feedback-preview {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Global Link Styling */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Dashboard Page Styles */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    margin-bottom: 0.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.dashboard-card h3 {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.dashboard-card .stat {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.5rem 0;
}

.dashboard-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.dashboard-card .email {
    font-size: 0.85rem;
    word-break: break-all;
}

.info-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.info-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.info-section > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.info-card h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.info-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.info-card.highlight {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
}

.info-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

.info-footer a {
    color: var(--primary);
    text-decoration: none;
}

.info-footer a:hover {
    text-decoration: underline;
}

/* Usage Instructions */
.usage-instructions {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.usage-instructions h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.usage-instructions p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.usage-instructions pre {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.usage-instructions code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.6;
}

.usage-instructions .text-muted {
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Profile Page Styles */
.profile-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.profile-section .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.info-item span {
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1rem;
    max-width: 400px;
}

.profile-section .text-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.danger-section {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.danger-section h2 {
    color: #dc3545;
    border-bottom-color: #dc3545;
}

.danger-warning {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.danger-warning strong {
    color: #dc3545;
}

.danger-warning ul {
    margin-top: 0.5rem;
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.danger-warning li {
    margin-bottom: 0.25rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.info-box {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.info-box h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.info-box p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.info-box ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-box li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.info-box .text-muted {
    font-size: 0.85rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Sessions Page Styles */
.container h1 a {
    color: var(--text);
    text-decoration: none;
}

.container h1 a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.search-box {
    margin: 1.5rem 0;
}

.search-box form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-box .form-control {
    flex: 0 1 300px;
}

.pagination-inline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.sessions-list {
    margin-top: 1.5rem;
}

.session-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.session-header h3 {
    font-size: 1rem;
    margin: 0;
    flex: 1;
}

.session-header h3 a {
    color: var(--text);
    text-decoration: none;
}

.session-header h3 a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.session-header .meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.summary {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.tags {
    margin: 0.75rem 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-dark);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.session-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

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

.page-num.current {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
}

.btn.disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text);
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: all 0.3s;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .feature-grid { grid-template-columns: 1fr; }

    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #0a1629;
        border-top: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .navbar-menu.open {
        display: flex;
    }

    .navbar-menu a,
    .navbar-menu .btn-link {
        display: block;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border);
    }

    .navbar-menu a:last-child,
    .navbar-menu form:last-child .btn-link {
        border-bottom: none;
    }

    .navbar .container {
        position: relative;
    }

    /* Hide inline pagination on mobile, show only bottom pagination */
    .pagination-inline {
        display: none;
    }

    /* Sessions table: show only checkbox and title on mobile */
    .sessions-table th:nth-child(2),
    .sessions-table td:nth-child(2),
    .sessions-table th:nth-child(4),
    .sessions-table td:nth-child(4),
    .sessions-table th:nth-child(5),
    .sessions-table td:nth-child(5),
    .sessions-table th:nth-child(6),
    .sessions-table td:nth-child(6) {
        display: none;
    }

    /* Mobile: full-width cards, minimal container padding */
    .container {
        padding: 0 0.5rem;
    }

    .container > h1,
    .container > p,
    .container > .alert {
        padding: 0 0.5rem;
    }

    .grid-two {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 0 -0.5rem;
    }

    .card-box {
        border-radius: 0;
        border-left: none;
        border-right: none;
        max-width: 95vw;
    }

    /* API keys table: hide Created column on mobile */
    .card-box .table.tight th:nth-child(3),
    .card-box .table.tight td:nth-child(3) {
        display: none;
    }

    /* Hide time portion on mobile */
    .time-part {
        display: none;
    }
}

/* Invitation Code Validation Styles */
.input-with-validation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.validation-status {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    min-width: 150px;
}

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

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

.validation-status.invalid,
.validation-status.error {
    color: var(--error);
}

.text-error {
    color: var(--error);
}

/* Registration Mode Selector */
.mode-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-dark);
}

.mode-option:hover {
    border-color: var(--primary);
    background: var(--bg-card);
}

.mode-option.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.mode-option input[type="radio"] {
    margin-top: 0.25rem;
    cursor: pointer;
}

.mode-details {
    flex: 1;
}

.mode-details strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text);
}

.mode-details p {
    margin-bottom: 0.5rem;
    color: var(--text);
    line-height: 1.5;
}

.mode-details small {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.info-box {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.info-box strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.info-box p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.radio-group {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* ==========================================================================
   Session Detail Page Styles
   ========================================================================== */

.back-link { margin-bottom: 1.5rem; }
.back-link a { color: var(--text-muted); text-decoration: none; }
.back-link a:hover { color: var(--text); }

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.session-detail h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.meta-info {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.summary-section, .body-section {
    margin-top: 2rem;
}

.summary-section h2, .body-section h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-section p {
    color: var(--text);
    line-height: 1.6;
}

.body-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    margin-bottom: 3rem;
}

.body-content code.hljs {
    background: transparent;
    padding: 0;
}

/* ==========================================================================
   API Keys Page Styles
   ========================================================================== */

.grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-card);
    overflow-x: auto;
}

.card-header h2 { margin: 0 0 0.25rem 0; }

.form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-inline input { flex: 1; }

.table.tight th, .table.tight td {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.table.tight {
    width: 100%;
    table-layout: auto;
}

.inline-form { display: inline; }

.new-key-box {
    border: 1px dashed var(--border);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.radio-inline {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.form-group.compact { margin-bottom: 0.5rem; }

.intro { margin-bottom: 1rem; }

.recalletta-ai-option {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
}

#custom-ai-section.collapsed,
.ai-grid.collapsed,
#ai-keys-note.collapsed {
    opacity: 0.5;
    pointer-events: none;
}

/* ==========================================================================
   Sessions List Page Styles
   ========================================================================== */

.sessions-table {
    font-size: 0.92rem;
    width: 100%;
}

.sessions-table .mono {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: var(--text-muted);
}

.sessions-table .title-cell a {
    font-weight: 600;
    color: var(--text);
}

.sessions-table .summary-small {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.25rem;
    max-height: 3.6em;
    overflow: hidden;
}

.meta-small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.sessions-table .tag {
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin: 0 0.15rem 0.15rem 0;
    display: inline-block;
    font-size: 0.75rem;
}

.sessions-table .actions {
    white-space: nowrap;
}

/* ==========================================================================
   Collapsible Sections (Session Detail)
   ========================================================================== */

.collapsible-section {
    margin-top: 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.collapsible-header::-webkit-details-marker {
    display: none;
}

.collapsible-header::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.collapsible-section[open] .collapsible-header::before {
    transform: rotate(90deg);
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.collapsible-header h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.collapsible-header .size-label {
    font-size: 0.75rem;
    font-weight: normal;
    margin-left: 0.75rem;
}

.collapsible-section .body-content {
    margin: 0;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
}

.session-id-label {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Editable Sections (Session Detail) */
.editable-section {
    margin-top: 2rem;
}

.editable-section h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.editable-textarea {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    width: 100%;
    padding: 1rem;
}

.editable-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.editable-textarea.body-textarea {
    min-height: 400px;
}

.editable-textarea.summary-textarea {
    min-height: 80px;
    overflow: hidden;
    resize: none;
}

#saveBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Processing status badge */
.processing-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 3px;
    vertical-align: middle;
}

/* Utility helpers */
.section-spaced {
    margin-top: 2rem;
}

.info-spaced {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-1-5 {
    margin-bottom: 1.5rem;
}

.flex-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.status-available {
    color: var(--success);
}

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

.stat-success {
    color: var(--success);
}

.form-divider {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
