/* ══════════════════════════════════════════════════════════════
   L-GNM Protein Dynamics Server — Complete Stylesheet
   ══════════════════════════════════════════════════════════════ */

/* ── Reset & Variables ────────────────────────────────────── */
:root {
    --bg:          #f8f9fa;
    --bg-card:     #ffffff;
    --bg-dark:     #0f1117;
    --text:        #1a1a2e;
    --text-muted:  #6b7280;
    --text-light:  #9ca3af;
    --primary:     #2563eb;
    --primary-dark:#1d4ed8;
    --primary-light:#dbeafe;
    --accent:      #0ea5e9;
    --accent2:     #8b5cf6;
    --success:     #10b981;
    --warning:     #f59e0b;
    --danger:      #ef4444;
    --border:      #e5e7eb;
    --border-light:#f3f4f6;
    --shadow-sm:   0 1px 2px rgba(0,0,0,0.05);
    --shadow:      0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:   0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-xl:   0 20px 40px -10px rgba(0,0,0,0.15);
    --radius:      12px;
    --radius-sm:   8px;
    --radius-xs:   4px;
    --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono:        'JetBrains Mono', 'Fira Code', monospace;
    --transition:  all 0.2s ease;
    --nav-h:       60px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

code {
    font-family: var(--mono);
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-size: 0.88em;
    color: var(--accent2);
}


/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-logo {
    height: 32px;
    width: auto;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.nav-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 4px;
    display: none;
}

@media (min-width: 768px) {
    .nav-subtitle { display: inline; }
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text);
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        background: var(--bg-card);
        padding: 12px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .nav-toggle { display: block; }
}


/* ── Main Content ─────────────────────────────────────────── */
.main-content {
    margin-top: var(--nav-h);
    flex: 1;
}


/* ── Hero ─────────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(15,17,23,0.82) 0%,
        rgba(37,99,235,0.65) 50%,
        rgba(14,165,233,0.55) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px 24px;
    max-width: 800px;
}

.hero-title{
    font-family:"Manrope",'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size:clamp(2.6rem,5vw,3.9rem);
    font-weight:800;
    line-height:1.08;
    letter-spacing:-0.045em;
    color:#fff;
    margin-bottom:12px;
    text-shadow:0 2px 8px rgba(0,0,0,.18);
    text-rendering:optimizeLegibility;
    -webkit-font-smoothing:antialiased;
}

.hero-title .accent{
    color:#6ea8ff;
}

.hero-accent {
    display: block;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 400;
    color: rgba(255,255,255,0.85);
    margin-top: 8px;
    letter-spacing: 0.02em;
}

.hero-desc {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.8);
    margin: 20px 0 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}


/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 80, 252, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    background: #0284c7;
    color: #fff;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: var(--radius);
}

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

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


/* ── Sections & Containers ────────────────────────────────── */
.section {
    padding: 60px 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 36px;
    text-align: center;
    letter-spacing: -0.02em;
}


/* ── Feature Cards (Home) ─────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--text);
}

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


/* ── Steps (Quick Start) ─────────────────────────────────── */
.quickstart-section {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.step-card {
    text-align: center;
    padding: 24px;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.step-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

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


/* ── Input Section (Analysis) ─────────────────────────────── */
.input-section {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.input-grid {
    display: flex;
    gap: 24px;
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: center;
}

.input-card {
    flex: 1;
    min-width: 300px;
    max-width: 460px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.input-card h3 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-divider {
    display: flex;
    align-items: center;
    padding: 0 8px;
}
.input-divider span {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.input-row {
    display: flex;
    gap: 10px;
}

.text-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    background: var(--bg-card);
    color: var(--text);
    transition: var(--transition);
    outline: none;
}

.text-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

.select-input {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}
.select-input:focus {
    border-color: var(--primary);
}

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


/* ── Upload Zone ──────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-card);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

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

.upload-hint {
    font-size: 0.8rem !important;
    color: var(--text-light) !important;
}


/* ── Chain Panel ──────────────────────────────────────────── */
.chain-panel {
    margin-top: 20px;
    padding: 20px 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.3s ease;
}

.chain-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.chain-badge {
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.chain-select-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.chain-select-row label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}


/* ── Progress ─────────────────────────────────────────────── */
.progress-panel {
    margin-top: 20px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-text {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}


/* ── Results Banner ───────────────────────────────────────── */
.results-banner {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.banner-item {
    flex: 1;
    min-width: 140px;
    padding: 16px 20px;
    border-right: 1px solid var(--border);
    text-align: center;
}
.banner-item:last-child { border-right: none; }

.banner-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.banner-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--mono);
}


/* ── Viewer Layout ────────────────────────────────────────── */
.viewer-layout {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    min-height: 560px;
}

.viewer-main {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.viewer-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 2px;
}

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

.tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}
.tool-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.tool-btn.active {
    background: var(--primary);
    color: #fff;
}

.molstar-container {
    flex: 1;
    min-height: 480px;
    background: #000;
}


/* ── Residue Tooltip ──────────────────────────────────────── */
.residue-tooltip {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    font-size: 0.85rem;
    transition: var(--transition);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.tt-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    color: var(--text-muted);
}

.tt-row span:last-child {
    font-weight: 600;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.85rem;
}


/* ── Color Legend ─────────────────────────────────────────── */
.color-legend {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    z-index: 50;
    min-width: 180px;
}

.legend-gradient {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg,
        #2166ac 0%, #67a9cf 20%, #f7f7f7 50%,
        #ef8a62 80%, #b2182b 100%);
    margin-bottom: 6px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}


/* ── Sidebar ──────────────────────────────────────────────── */
.viewer-sidebar {
    width: 260px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    transition: width 0.3s ease;
    position: relative;
}

.viewer-sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-left: none;
}

.sidebar-toggle {
    position: absolute;
    top: 12px;
    left: -16px;
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.sidebar-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-content {
    padding: 16px;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    padding: 4px 0;
}

.radio-item input[type="radio"] {
    accent-color: var(--primary);
}

.sidebar-section .btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 6px;
}

.download-btn {
    font-size: 0.78rem !important;
}


/* ── Plots Grid ───────────────────────────────────────────── */
.plots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.plot-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.plot-card.full-width {
    grid-column: 1 / -1;
}

.plot-card h3 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plot-container {
    width: 100%;
    height: 320px;
}


/* ── Data Table ───────────────────────────────────────────── */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.table-card h3 {
    font-size: 1rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-search {
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    font-family: var(--font);
    width: 200px;
    outline: none;
}
.table-search:focus { border-color: var(--primary); }

.table-scroll {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead {
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 5;
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.data-table th:hover { color: var(--primary); }

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    font-family: var(--mono);
    font-size: 0.82rem;
}

.data-table tbody tr:hover {
    background: var(--primary-light);
    cursor: pointer;
}

.data-table tbody tr.highlighted {
    background: #fef3c7;
}


/* ── Manual ───────────────────────────────────────────────── */
.manual-section {
    background: var(--bg-card);
}

.manual-container {
    max-width: 850px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.manual-toc {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 28px;
    margin-bottom: 40px;
}

.manual-toc h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.manual-toc ol {
    padding-left: 20px;
}

.manual-toc li {
    margin-bottom: 6px;
}

.manual-toc a {
    font-size: 0.9rem;
    color: var(--primary);
}

.manual-article {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
}

.manual-article h2 {
    font-size: 1.35rem;
    margin-bottom: 16px;
    color: var(--text);
}

.manual-article h3 {
    font-size: 1.05rem;
    margin: 20px 0 10px;
    color: var(--text);
}

.manual-article p,
.manual-article li {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-muted);
}

.manual-article ul {
    padding-left: 24px;
    margin: 10px 0;
}

.manual-article li {
    margin-bottom: 6px;
}

.note-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-xs);
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 0.9rem;
    color: var(--text);
}

.note-box.note-warning {
    background: #fef3c7;
    border-left-color: var(--warning);
}

.manual-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 0.9rem;
}

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

.manual-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
}

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

.aa-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.aa-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--mono);
}

.aa-badge.aa-flex {
    background: #fecaca;
    color: #991b1b;
}

.aa-badge.aa-rigid {
    background: #dbeafe;
    color: #1e40af;
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item h4 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 6px;
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding-left: 12px;
}


/* ── Contact ──────────────────────────────────────────────── */
.contact-section {
    background: var(--bg-card);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.contact-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.contact-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

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

.citation-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 12px;
    margin-top: 8px;
    text-align: left;
}

.citation-box code {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
    background: none;
    padding: 0;
}


/* ── Feedback Form ────────────────────────────────────────── */
.feedback-form {
    max-width: 680px;
    margin: 0 auto;
}

.feedback-form h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

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

.form-group .text-input,
.form-group .select-input {
    width: 100%;
}


/* ── Footer ───────────────────────────────────────────────── */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 24px 0;
    margin-top: auto;
}

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

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.footer-logo {
    height: 22px;
    opacity: 0.6;
}

.footer-center {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

.footer-right {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}


/* ── Utilities ────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s infinite;
}


/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 960px) {
    .viewer-layout {
        flex-direction: column;
    }
    .viewer-sidebar {
        width: 100% !important;
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: 300px;
    }
    .sidebar-toggle { display: none; }
    .plots-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hero { min-height: 400px; }
    .hero-title { font-size: 1.8rem; }
    .results-banner {
        flex-direction: column;
    }
    .banner-item {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .input-grid {
        flex-direction: column;
    }
    .input-divider {
        padding: 8px 0;
    }
}


/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
    position: fixed;
    top: calc(var(--nav-h) + 12px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--primary); }

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

/* ── Flex bar coloring ────────────────────────────────────── */
.flex-bar-rigid    { background-color: #2166ac; }
.flex-bar-neutral  { background-color: #f7f7f7; }
.flex-bar-flexible { background-color: #b2182b; }

/* ── Input Layout — RCSB + Upload side by side, AF below ── */
.input-grid-row {
    display: flex;
    gap: 20px;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.input-grid-row .input-card {
    flex: 1;
    min-width: 280px;
    max-width: 480px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.input-divider-v {
    display: flex;
    align-items: center;
    padding: 0 8px;
}
.input-divider-v span {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.input-af-row {
    display: flex;
    justify-content: center;
}

.input-card-af {
    width: 100%;
    max-width: 980px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.input-card-af .input-row {
    max-width: 500px;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 8px;
}

.input-card h3 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Source Badge ──────────────────────────────────────────── */
.source-badge {
    margin-top: 16px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}
.source-badge.alphafold {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.source-badge.experimental {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}
.source-badge.unknown {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.plddt-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--mono);
}
.plddt-badge.high   { background: #c8e6c9; color: #2e7d32; }
.plddt-badge.medium { background: #fff9c4; color: #f57f17; }
.plddt-badge.low    { background: #ffcdd2; color: #c62828; }

/* ── Method Warning ───────────────────────────────────────── */
.method-warning {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-left: 4px solid #ff9800;
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: #e65100;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-title {
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-muted);
}

/* ── Responsive for input ─────────────────────────────────── */
@media (max-width: 768px) {
    .input-grid-row {
        flex-direction: column;
        align-items: center;
    }
    .input-grid-row .input-card {
        max-width: 100%;
    }
    .input-divider-v {
        padding: 4px 0;
    }
}