/* Design System & Reset */
:root {
    --bg-main: #ffffff;
    --bg-offset: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fef2f2;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-offset);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

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

/* Header & Navigation */
.main-header {
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 0.25rem;
    border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Sections General */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.section:last-of-type {
    border-bottom: none;
}

.section-header {
    max-width: 700px;
    margin-bottom: 3.5rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Hero Section */
.hero-section {
    padding: 6rem 1.5rem;
    background-color: var(--bg-main);
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.15;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 300;
    max-width: 600px;
}

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

.hero-visual {
    display: flex;
    justify-content: center;
}

.visual-box {
    background-color: var(--bg-offset);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.sensor-blueprint {
    width: 100%;
    height: auto;
}

.sensor-tag {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Predict Section & Grid */
.predictor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.input-panel, .result-panel {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    min-height: 500px;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.panel-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Forms & Segmented Controls */
.control-group {
    margin-bottom: 1.75rem;
}

.control-label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.control-help {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.segmented-control {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-offset);
    overflow: hidden;
    padding: 2px;
}

.segment-btn {
    flex: 1;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.6rem 0.5rem;
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 2px);
    transition: var(--transition);
}

.segment-btn:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.segment-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-main);
    box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-main);
}

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

.btn-secondary {
    background-color: var(--bg-main);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

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

.btn-block {
    display: flex;
    width: 100%;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Result Card */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    height: 100%;
    min-height: 350px;
}

.placeholder-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.result-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

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

.result-header {
    background-color: var(--bg-offset);
    border-bottom: 1px solid var(--border-color);
    padding: 1.75rem;
    text-align: center;
}

.result-header-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.result-activity-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.confidence-container {
    max-width: 300px;
    margin: 0 auto;
}

.confidence-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.35rem;
}

.confidence-bar-outer {
    height: 8px;
    background-color: var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.confidence-bar-inner {
    height: 100%;
    background-color: var(--success);
    border-radius: var(--radius-sm);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.confidence-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.result-details {
    padding: 1.75rem;
}

.details-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

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

.detail-value {
    font-weight: 600;
}

.highlight-value {
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
}

.model-info-footer {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Probability Distribution Chart */
.probabilities-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prob-row {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

.prob-name {
    width: 140px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prob-bar-outer {
    flex: 1;
    height: 16px;
    background-color: var(--bg-offset);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-right: 0.75rem;
}

.prob-bar-inner {
    height: 100%;
    background-color: #cbd5e1; /* Neutral slate-300 default */
    transition: width 0.6s ease;
}

.prob-bar-inner.highlight {
    background-color: var(--accent);
}

.prob-val {
    width: 45px;
    text-align: right;
    font-weight: 600;
    font-family: var(--font-heading);
}

/* Error/No Match Card */
.error-card {
    padding: 2.5rem 2rem;
    text-align: center;
    border-color: var(--warning);
    background-color: var(--warning-light);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--warning);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.error-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.error-suggestions {
    text-align: left;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    font-size: 0.85rem;
}

.error-suggestions ul {
    margin-top: 0.5rem;
    margin-left: 1.25rem;
}

.error-suggestions li {
    margin-bottom: 0.35rem;
}

/* Real UCI Sample Validation Section */
.sample-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 3rem;
}

.sample-control-card, .sample-result-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    min-height: 400px;
}

.sample-input-group {
    margin-bottom: 1.5rem;
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.input-text {
    flex: 1;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

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

.sample-result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.sample-badge {
    background-color: var(--bg-offset);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.sample-badge.accent {
    background-color: var(--accent-light);
    border-color: rgba(37, 99, 235, 0.2);
    color: var(--accent);
}

.comparison-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.comp-box {
    display: flex;
    flex-direction: column;
}

.comp-box.border-left {
    border-left: 1px solid var(--border-color);
    padding-left: 1.5rem;
}

.comp-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.comp-value {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.comp-sublabel {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.text-blue {
    color: var(--accent);
}

.validation-status {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.status-correct {
    background-color: var(--success-light);
    color: var(--success);
}

.status-incorrect {
    background-color: var(--error-light);
    color: var(--error);
}

/* Model Section & Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3rem;
    align-items: start;
}

.metadata-card, .charts-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.metadata-table-container {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.metadata-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.metadata-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.metadata-table tr:last-child td {
    border-bottom: none;
}

.metadata-table td:first-child {
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-offset);
    width: 60%;
}

.metadata-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.font-mono {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.85rem;
}

.font-bold {
    font-weight: 700 !important;
}

.text-green {
    color: var(--success);
}

.retrain-container {
    margin-top: 1.5rem;
}

.retrain-status {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Visualizations / Tabs */
.tabs-container {
    display: flex;
    flex-direction: column;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.tab-btn {
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.75rem 0.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab-btn:hover, .tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.tab-content {
    display: none;
}

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

.chart-img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    object-fit: contain;
    margin-bottom: 1rem;
}

.chart-caption {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Pipeline Flow */
.pipeline-section {
    background-color: var(--bg-main);
}

.pipeline-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.flow-step {
    flex: 1;
    background-color: var(--bg-offset);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.step-num {
    width: 28px;
    height: 28px;
    background-color: var(--text-primary);
    color: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 auto 1rem auto;
}

.step-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

.flow-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: bold;
}

.scientific-rule-box {
    background-color: var(--bg-offset);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 1.75rem;
}

.rule-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.rule-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.rule-text:last-child {
    margin-bottom: 0;
}

/* Activities Grid */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.activity-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

.activity-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.activity-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-offset);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.loading-box {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.loading-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.loading-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2.5rem auto;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

.loading-steps {
    list-style: none;
    text-align: left;
    max-width: 300px;
    margin: 0 auto 1.5rem auto;
    font-size: 0.85rem;
}

.loading-steps li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.loading-steps li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.loading-steps li.pending::before {
    background-color: var(--text-muted);
    animation: pulse 1s infinite alternate;
}

.loading-steps li.running::before {
    background-color: var(--accent);
    animation: pulse 0.5s infinite alternate;
}

.loading-steps li.success::before {
    background-color: var(--success);
}

.loading-steps li.success {
    color: var(--text-secondary);
}

.loading-steps li.error::before {
    background-color: var(--error);
}

.loading-steps li.error {
    color: var(--error);
}

@keyframes pulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.loading-error {
    background-color: var(--error-light);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.loading-error p {
    color: var(--error);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.loading-error .btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.hidden {
    display: none !important;
}

/* Footer */
.main-footer {
    background-color: var(--text-primary);
    color: var(--bg-offset);
    padding: 3rem 1.5rem;
    text-align: center;
    border-top: 1px solid #1e293b;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-container p {
    margin-bottom: 0.5rem;
}

.footer-subtext {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ===== Live Sensor Section ===== */
.live-section {
    background-color: var(--bg-offset);
}

.live-pipeline-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 3rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pipeline-step-mini {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    background-color: var(--bg-offset);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.pipeline-arrow-mini {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: bold;
}

.live-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.live-control-card, .live-result-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    min-height: 420px;
}

.sensor-support-note {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    background-color: var(--bg-offset);
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.sensor-support-note.supported {
    background-color: var(--success-light);
    border-color: rgba(22, 163, 74, 0.2);
    color: var(--success);
}

.sensor-support-note.not-supported {
    background-color: var(--error-light);
    border-color: rgba(220, 38, 38, 0.2);
    color: var(--error);
}

.live-error-msg {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--error-light);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--error);
}

.sensor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.sensor-block {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    background-color: var(--bg-offset);
}

.sensor-block-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
}

.sensor-block-unit {
    font-weight: 400;
}

.sensor-axes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sensor-axis {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.axis-name {
    width: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.axis-bar-outer {
    flex: 1;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.axis-bar-inner {
    height: 100%;
    width: 50%; /* default 50% = 0.0 value, left=negative, right=positive */
    background-color: #94a3b8;
    transition: width 0.15s ease, background-color 0.15s ease;
    border-radius: 3px;
}

.axis-bar-inner.axis-x { background-color: #2563eb; }
.axis-bar-inner.axis-y { background-color: #0e7490; }
.axis-bar-inner.axis-z { background-color: #475569; }

.axis-val {
    width: 44px;
    text-align: right;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.window-accumulator {
    background-color: var(--bg-offset);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.window-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.window-bar-outer {
    height: 8px;
    background-color: var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.window-bar-inner {
    height: 100%;
    background-color: var(--accent);
    border-radius: var(--radius-sm);
    transition: width 0.1s ease;
    width: 0%;
}

.window-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.live-controls-row {
    display: flex;
    gap: 0.75rem;
}

/* Live result card */
.live-refresh-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 1.25rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

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

.live-result-header {
    background-color: var(--bg-offset);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.live-probabilities-section {
    margin-bottom: 1.25rem;
}

.live-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
}

.live-disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    background-color: var(--bg-offset);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.75rem 1rem;
    line-height: 1.6;
}

/* ===== Responsive ===== */

@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-visual {
        order: -1;
    }
    .predictor-grid, .sample-grid, .dashboard-grid, .live-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pipeline-flow {
        flex-direction: column;
        gap: 1.5rem;
    }
    .flow-arrow {
        transform: rotate(0deg);
    }
    .live-pipeline-banner {
        justify-content: center;
    }
    .sensor-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    .hero-title {
        font-size: 2.25rem;
    }
    .activities-grid {
        grid-template-columns: 1fr;
    }
    .details-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .comparison-boxes {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .comp-box.border-left {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 1.25rem;
    }
}
