/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Professional Color Palette - Scientific/Laboratory Theme */
:root {
    --primary-color: #2c5282;
    --primary-light: #4a7ba7;
    --primary-dark: #1a365d;
    --secondary-color: #2f855a;
    --accent-color: #d69e2e;
    --danger-color: #c53030;
    --success-color: #276749;
    --warning-color: #b7791f;
    --background-main: #f7fafc;
    --background-app: #f5f7fb;
    --background-card: #ffffff;
    --background-section: #edf2f7;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #cbd5e0;
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Body and Container */
body {
    font-family: var(--font-sans);
    background: var(--background-main);
    padding: 15px;
    min-height: 100vh;
    overflow: auto;
    color: var(--text-primary);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
}

.container {
    max-width: 1900px;
    margin: 0 auto;
    background: var(--background-card);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
    min-height: calc(100vh - 30px);
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border: 1px solid var(--border-light);
}

/* Header */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    position: relative;
}

.header-container::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 150px;
    height: 2px;
    background: var(--accent-color);
}

.header-container h1 {
    margin: 0;
    font-size: 22px;
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1;
}

.brand-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    height: 38px;
    width: auto;
    display: block;
}

.brand-mark.small {
    height: 30px;
}

.brand-mark.tiny {
    height: 24px;
}

.app-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

/* Project Controls */
.project-controls-compact {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
}

.project-info-compact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-info-compact input {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.35;
    width: 160px;
    min-height: 32px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-info-compact input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

.project-status {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--background-section);
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.project-buttons-compact {
    display: flex;
    gap: 3px;
}

.project-buttons-compact button {
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--background-card);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.project-buttons-compact button:hover {
    background: var(--background-section);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 4px;
    padding: 0;
    flex-shrink: 0;
}

.tab-button {
    background: var(--background-section);
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    position: relative;
    margin: 0;
}

.tab-button:hover {
    background: var(--border-light);
    color: var(--primary-color);
}

.tab-button.active {
    background: var(--background-card);
    color: var(--primary-color);
    box-shadow: 0 -2px 0 var(--primary-color) inset;
}

.tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: visible;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.tab-panel {
    height: 100%;
    padding: 8px 20px 20px;
    overflow-y: auto;
}

.tab-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: linear-gradient(180deg, var(--background-card) 0%, var(--background-section) 100%);
    border: 1px solid var(--border-light);
    border-bottom: 2px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.tab-panel-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-panel-header h2::before {
    content: '';
    width: 4px;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

/* Main Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.left-panel,
.middle-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 3px;
}

/* Custom Scrollbar */
.left-panel::-webkit-scrollbar,
.middle-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar,
.conditions-section::-webkit-scrollbar,
.datapoints-list::-webkit-scrollbar,
.peak-data-section::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track,
.middle-panel::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track,
.conditions-section::-webkit-scrollbar-track,
.datapoints-list::-webkit-scrollbar-track,
.peak-data-section::-webkit-scrollbar-track {
    background: var(--background-section);
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb,
.middle-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb,
.conditions-section::-webkit-scrollbar-thumb,
.datapoints-list::-webkit-scrollbar-thumb,
.peak-data-section::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    border: 2px solid var(--background-section);
}

.left-panel::-webkit-scrollbar-thumb:hover,
.middle-panel::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover,
.conditions-section::-webkit-scrollbar-thumb:hover,
.datapoints-list::-webkit-scrollbar-thumb:hover,
.peak-data-section::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Section Cards */
.section {
    background: var(--background-section);
    border-radius: 6px;
    padding: 10px;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.section.scrollable {
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
    min-height: 150px;
    max-height: 500px;
}

.section.compact {
    padding: 8px;
}

.section h2 {
    font-size: 0.95em;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.section h2::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 1px;
}

.section h3 {
    font-size: 0.9em;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 600;
}

/* Chromatogram Container */
.chromatogram-container {
    background: linear-gradient(135deg, var(--background-card) 0%, var(--background-section) 100%);
    border-radius: 8px;
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    max-height: 100%;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.chromatogram-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-shrink: 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.chromatogram-title {
    color: var(--primary-color);
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chromatogram-title::before {
    content: '📈';
    font-size: 1.1em;
}

/* Chromatogram Controls */
.chromatogram-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 4px;
    align-items: center;
    background: var(--background-card);
    padding: 4px 8px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    justify-content: space-between;
}

.chromatogram-controls-left {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1;
}

.chromatogram-controls-right {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

.control-group {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    min-width: auto;
}

.control-group label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    margin: 0;
}

.chromatogram-controls select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 10px;
    min-width: 120px;
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.chromatogram-controls input[type="number"] {
    width: 55px;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.chromatogram-controls select:focus,
.chromatogram-controls input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

/* Custom Range Controls */
.custom-range-controls {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin: 0;
    flex-shrink: 0;
    border: none;
}

.custom-range-controls input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 10px;
    transition: all 0.3s ease;
}

.custom-range-controls input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

.custom-range-controls span {
    font-size: 10px;
    color: var(--text-muted);
}

/* Toggle Controls */
.toggle-controls {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    align-items: center;
}

.toggle-controls button {
    background: var(--background-card);
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    margin-top: 0;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.toggle-controls button:hover {
    background: var(--background-section);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.toggle-controls button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.checkbox-control {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* Canvas */
.chromatogram-canvas {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    width: 100% !important;
    height: 460px !important;
    max-height: 460px !important;
    display: block;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

/* Legend */
.legend {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    font-size: 10px;
    flex-wrap: wrap;
    background: var(--background-card);
    padding: 5px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    min-height: 28px;
    border: 1px solid var(--border-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-color {
    width: 20px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid var(--border-light);
}

/* Form Elements */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select {
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.35;
}

textarea {
    width: 100%;
    font-family: var(--font-sans);
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    font-size: 10px;
    background: white;
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-height: 70px;
}

#methodDescription,
#additionalComments,
#defaultMethodNotes {
    font-family: var(--font-sans) !important;
    font-size: 13px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

button {
    background: var(--primary-color);
    color: white;
    font-family: var(--font-sans);
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

button:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button:disabled:hover {
    background: inherit;
}

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

button.danger:hover {
    background: #9b2c2c;
}

button.secondary, a.secondary {
    background: var(--text-muted);
    color: white;
}

button.secondary:hover, a.secondary:hover {
    background: var(--text-secondary);
}

button.small, a.small {
    padding: 4px 8px;
    font-size: 10px;
    margin: 0;
    letter-spacing: 0.2px;
    text-decoration: none;
}

/* Status Messages */
.status-message {
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-message::before {
    font-size: 16px;
}

.error {
    background: #fed7d7;
    color: var(--danger-color);
    border-left: 3px solid var(--danger-color);
}

.error::before {
    content: '⚠️';
}

.success {
    background: #c6f6d5;
    color: var(--success-color);
    border-left: 3px solid var(--success-color);
}

.success::before {
    content: '✓';
}

.warning {
    background: #fef3c7;
    color: var(--warning-color);
    border-left: 3px solid var(--warning-color);
}

.warning::before {
    content: '⚠️';
}

/* Condition Inputs */
.initial-condition-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.initial-condition-row label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.initial-condition-row select {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 12px;
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.initial-condition-row select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

.target-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.target-condition-group {
    flex: 1;
    min-width: 100px;
}

.target-condition-group label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.target-condition-group input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.target-condition-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    margin-top: 6px;
    background: white;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

table tbody, table thead {
    display: table;
    width: 100%;
    table-layout: auto;
}

th {
    background: var(--primary-color);
    color: white;
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

th small {
    display: block;
    font-weight: normal;
    opacity: 0.9;
    margin-top: 2px;
    text-transform: none;
}

td {
    padding: 4px;
    border-bottom: 1px solid var(--border-light);
    font-size: 10px;
    white-space: nowrap;
    min-width: 60px;
}

tr:hover {
    background: var(--background-section);
}

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

#resultsTable {
    display: table;
    width: 100%;
    max-width: none;
}

#resultsTable th,
#resultsTable td {
    min-width: 70px;
}

.results-detail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.results-panel {
    display: flex;
    flex-direction: column;
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.results-content > * {
    min-width: 0;
}

.results-detail-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 10px;
    box-shadow: var(--shadow-sm);
}

.results-detail-card-error {
    border-color: #fed7d7;
    background: #fffaf9;
}

.results-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.results-detail-peak {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-size: 13px;
}

.results-detail-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.results-detail-metric {
    background: var(--background-section);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 6px 8px;
    min-width: 0;
}

.results-detail-metric-label {
    display: block;
    margin-bottom: 2px;
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.35px;
}

.results-detail-metric-value {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.results-metric-positive .results-detail-metric-value {
    color: var(--success-color);
}

.results-metric-negative .results-detail-metric-value {
    color: var(--danger-color);
}

.results-metric-neutral .results-detail-metric-value {
    color: var(--text-primary);
}

.results-detail-note {
    margin-bottom: 8px;
    color: var(--danger-color);
    font-size: 11px;
    font-weight: 600;
}

.results-step-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px;
}

.results-step {
    min-width: 0;
    background: #fbfdff;
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--primary-light);
    border-radius: 4px;
    padding: 8px;
}

.results-step-modeled {
    border-left-color: var(--primary-color);
}

.results-step-warning {
    border-left-color: var(--warning-color);
    background: #fffaf0;
}

.results-step-muted {
    border-left-color: var(--text-muted);
    background: #f8fafc;
}

.results-step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.results-step-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color);
}

.results-step-range {
    font-size: 10px;
    color: var(--text-secondary);
}

.results-step-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.35;
}

.results-step-status {
    margin-top: 4px;
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.25px;
    text-transform: uppercase;
}

@media (min-width: 769px) and (max-width: 1400px) {
    #overview-tab.tab-content.active {
        overflow: hidden;
    }

    #overview-tab .main-layout {
        height: 100%;
        min-height: 0;
        align-items: stretch;
    }

    .right-panel {
        height: 100%;
        min-height: 0;
        overflow-y: hidden !important;
    }

    .results-panel.section.scrollable {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .results-content {
        flex: 0 0 auto;
        overflow: visible;
    }

    .results-content.results-detailed-active {
        background: #e8f1f8;
        border: 1px solid #d6e3ef;
        border-radius: 6px;
        padding: 8px;
    }

    .results-content.results-detailed-active .results-detail-list {
        align-content: start;
    }
}

@media (min-width: 1001px) and (max-width: 1400px) {
    #overview-tab .left-panel > .section.scrollable {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
}

@media (min-width: 1401px) {
    .container[data-active-tab="overview"] {
        height: calc(100vh - 30px);
        max-height: calc(100vh - 30px);
        overflow: hidden;
    }

    .container[data-active-tab="overview"] #overview-tab.tab-content.active {
        overflow: hidden;
    }

    .container[data-active-tab="overview"] #overview-tab .main-layout {
        height: 100%;
        min-height: 0;
        align-items: stretch;
    }

    .container[data-active-tab="overview"] .right-panel {
        height: 100%;
        min-height: 0;
        overflow-y: hidden !important;
    }

    .container[data-active-tab="overview"] .results-panel.section.scrollable {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .container[data-active-tab="overview"] .results-content {
        flex: 0 0 auto;
        overflow: visible;
    }

    .container[data-active-tab="overview"] .results-content.results-detailed-active {
        background: #e8f1f8;
        border: 1px solid #d6e3ef;
        border-radius: 6px;
        padding: 8px;
    }

    .container[data-active-tab="overview"] .results-content.results-detailed-active .results-detail-list {
        align-content: start;
    }

    .container[data-active-tab="overview"] .left-panel > .section.scrollable {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
}

.peak-row {
    font-weight: 500;
}

/* Resolution Info */
.resolution-info {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    padding: 6px;
    font-size: 11px;
    box-shadow: var(--shadow-sm);
    overflow: visible;
}

.resolution-info h4 {
    color: var(--primary-color);
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.resolution-pairs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.resolution-pair {
    width: 100%;
    background: var(--background-section);
    padding: 5px 8px;
    border-radius: 3px;
    border: 1px solid var(--border-light);
    font-weight: 500;
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.resolution-pair strong {
    display: block;
    margin-bottom: 2px;
}

.resolution-good { border-left: 3px solid var(--success-color); }
.resolution-poor { border-left: 3px solid var(--warning-color); }
.resolution-bad { border-left: 3px solid var(--danger-color); }

.resolution-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.resolution-heading h4 {
    margin: 0;
}

.resolution-heading span {
    color: var(--text-muted);
    font-size: 10px;
    font-style: italic;
}

.resolution-heading button {
    margin: 0 0 0 auto;
}

.resolution-pair {
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.resolution-pair:hover,
.resolution-pair:focus-visible,
.resolution-pair.pinned {
    background: #e8f1f8;
    box-shadow: 0 0 0 1px var(--primary-light);
    outline: none;
    transform: translateY(-1px);
}

.resolution-pair.pinned::after {
    content: 'PIN ' attr(data-pin);
    position: absolute;
    top: 5px;
    right: 7px;
    color: var(--primary-color);
    font-size: 8px;
    font-weight: 700;
}

.resolution-pair.merged {
    border-style: dashed;
}

/* Peaks Tab */
.peaks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    gap: 12px;
    margin-top: 10px;
    padding-right: 5px;
    overflow-x: auto;
    overflow-y: visible;
}

.peak-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 10px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow-x: auto;
}

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

.peak-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 14px;
}

.peak-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.peak-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.peak-color-indicator.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.peak-color-indicator.clickable:hover {
    border-color: var(--primary-color);
    transform: scale(1.15);
    box-shadow: var(--shadow-md);
}

.peak-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.detail-group {
    background: var(--background-section);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.detail-group h5 {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    display: flex;
    gap: 8px;
    align-items: center;
}

.detail-value input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.detail-value input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

.detail-value span {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.detail-group-data-points {
    grid-column: 1 / -1;
}

.detail-value-data-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 6px;
    align-items: stretch;
}

.detail-value-data-points .detail-data-point-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 5px 7px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 4px;
}

.detail-value-data-points .detail-data-point-item span {
    font-size: 10px;
    color: var(--text-muted);
    white-space: normal;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.detail-value-data-points .detail-data-point-item strong {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Regression Stats */
.regression-stats {
    background: #ebf8ff;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid #bee3f8;
}

.regression-stats h5 {
    font-size: 10px;
    color: var(--primary-color);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px;
}

.stat-item {
    font-size: 10px;
    color: var(--text-secondary);
    background: white;
    padding: 5px 8px;
    border-radius: 3px;
    font-weight: 500;
}

.stat-item strong {
    color: var(--text-primary);
}

.quality-indicator {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: bold;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.quality-good {
    background: #c6f6d5;
    color: var(--success-color);
}

.quality-moderate {
    background: #feebc8;
    color: var(--warning-color);
}

.quality-poor {
    background: #fed7d7;
    color: var(--danger-color);
}

/* Peak Data Tables */
.peak-data-section {
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.peak-data-section h5 {
    font-size: 12px;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.peak-data-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 10px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.peak-data-table thead {
    background: var(--primary-color);
    color: white;
}

.peak-data-table th {
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.peak-data-table td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--border-light);
}

.peak-data-table th:last-child,
.peak-data-table td:last-child {
    width: 80px;
}

.peak-data-table input {
    width: 100%;
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
}

.peak-data-table td button {
    width: 100%;
    margin-top: 0;
    padding: 5px 6px;
    white-space: nowrap;
}

.peak-data-table .editable-cell input {
    background: #fffbeb;
    border-color: var(--warning-color);
}

.add-row-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(96px, auto);
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: var(--background-section);
    border-radius: 4px;
    align-items: center;
}

.add-row-form > * {
    min-width: 0;
}

.add-row-form input,
.add-row-form select {
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 10px;
}

.add-row-form button {
    width: 100%;
    padding: 5px 10px;
    font-size: 10px;
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .add-row-form {
        grid-template-columns: 1fr;
    }
}

/* Conditions Tab */
.conditions-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    overflow-y: auto;
}

.conditions-header {
    flex-shrink: 0;
}

.conditions-header h2 {
    margin: 0;
}

.condition-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.condition-card h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
}

/* Nested Tabs */
.nested-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
}

.nested-tab-button {
    background: var(--background-section);
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nested-tab-button:hover {
    background: var(--border-light);
    color: var(--primary-color);
}

.nested-tab-button.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 -2px 0 var(--primary-color) inset;
}

.nested-tab-content {
    display: none;
    padding: 15px;
    background: var(--background-section);
    border-radius: 0 0 6px 6px;
}

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

/* Multi-condition Entry */
.multi-condition-entry {
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-md);
}

.multi-condition-entry h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1em;
    font-weight: 600;
}

.multi-entry-controls {
    background: var(--background-section);
    border-radius: 4px;
    padding: 10px;
    color: var(--text-primary);
}

.multi-entry-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.multi-entry-conditions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.multi-entry-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.multi-entry-input label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.multi-entry-input input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.multi-entry-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

.multi-entry-peak-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    min-width: 200px;
    background: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.multi-entry-peak-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

/* Condition Graphs */
.condition-graph-container {
    background: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.condition-graph-canvas {
    width: 100%;
    height: 300px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.graph-legend {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    padding: 8px;
    background: var(--background-section);
    border-radius: 4px;
}

.graph-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.condition-data-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

/* Datapoints List */
.datapoints-list {
    background: var(--background-section);
    border-radius: 6px;
    padding: 10px;
    margin: 12px 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

.datapoint-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.datapoint-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.datapoint-info {
    flex: 1;
}

.datapoint-info strong {
    color: var(--primary-color);
}

.add-datapoint-form {
    background: #ebf8ff;
    border-radius: 6px;
    padding: 15px;
    margin-top: 12px;
    border: 1px solid #bee3f8;
}

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

/* Utility Classes */
.value-display {
    min-width: 40px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.input-group {
    margin-bottom: 10px;
}

.input-group label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.input-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.button-group button {
    flex: 1;
    margin-top: 0;
    font-size: 12px;
    padding: 6px 12px;
}

.info-text {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding: 8px 10px;
    background: #ebf8ff;
    border-radius: 4px;
    border-left: 2px solid var(--primary-light);
    line-height: 1.4;
}

.hidden {
    display: none !important;
}

/* Results Controls */
.results-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.results-controls h2 {
    flex: 1;
    margin-bottom: 0;
}

.results-checkbox-control {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.peaks-tab-controls {
    flex-shrink: 0;
}

.peaks-control-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.peaks-view-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.peaks-view-control input[type="checkbox"] {
    margin: 0;
}

.peaks-view-control label {
    margin: 0;
    cursor: pointer;
}

/* Report Generation Styles */
.report-section {
    height: 100%;
    overflow-y: auto;
}

.report-header {
    flex-shrink: 0;
}

.report-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.report-setup {
    background: var(--background-section);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.report-form h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.report-field {
    margin-bottom: 15px;
}

.report-field label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.report-field input,
.report-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.report-field input:focus,
.report-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

.field-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.report-options {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.report-options h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 13px;
}

.report-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.report-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.report-checkbox-group label:hover {
    background: var(--background-card);
}

.report-checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Report Preview Styles */
.report-preview {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-top: 20px;
    overflow: visible;
}

.report-document {
    max-width: 900px;
    margin: 0 auto;
    overflow: visible;
}

.report-page {
    background: white;
    padding: 20px;
    overflow: visible;
}

.report-header-section {
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.report-header-section h1 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 20px;
}

.report-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.meta-row {
    display: flex;
    gap: 15px;
    padding: 5px 0;
}

.meta-label {
    font-weight: 600;
    min-width: 180px;
    color: var(--text-secondary);
}

.meta-value {
    color: var(--text-primary);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.report-body {
    margin-bottom: 40px;
}

.report-section-content {
    margin-bottom: 35px;
    page-break-inside: avoid;
}

.report-section-content h2 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
}

.report-section-content h3 {
    color: var(--primary-dark);
    font-size: 14px;
    margin: 15px 0 10px 0;
}

.report-section-content h4 {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 10px 0 5px 0;
}

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

/* Report Tables */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 13px;
}

.report-table th {
    background: var(--primary-color);
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 10px;
}

.report-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
}

.report-table tr:nth-child(even) {
    background: var(--background-section);
}

.report-table tr:hover {
    background: #ebf8ff;
}

.report-table.compact {
    font-size: 10px;
}

.report-table.compact td {
    padding: 5px 8px;
}

.report-table.compact-conditions {
    margin: 8px 0;
    font-size: 10px;
}

.report-table.compact-conditions th {
    padding: 6px 8px;
    font-size: 10px;
    background: var(--primary-color);
    color: white;
}

.report-table.compact-conditions td {
    padding: 6px 8px;
    font-weight: 600;
    text-align: center;
    background: var(--background-section);
}

.report-table.compact-conditions-left {
    width: auto;
    max-width: 400px;
    margin: 8px 0;
    border-collapse: collapse;
    font-size: 10px;
}

.report-table.compact-conditions-left th {
    background: var(--primary-color);
    color: white;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 10px;
}

.report-table.compact-conditions-left td {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    text-align: left;
    font-weight: 500;
}

.report-table.compact-conditions-left td:first-child {
    font-weight: 600;
    color: var(--text-secondary);
}

.report-table.compact-conditions-left tr:nth-child(even) {
    background: var(--background-section);
}

.report-table.compact-conditions-fullwidth,
.report-table.compact-conditions-horizontal {
    width: 100%;
    margin: 8px 0;
    border-collapse: collapse;
    font-size: 10px;
}

.report-table.compact-conditions-fullwidth th,
.report-table.compact-conditions-horizontal th {
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.report-table.compact-conditions-fullwidth td,
.report-table.compact-conditions-horizontal td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    font-weight: 600;
    background: var(--background-section);
}

.peak-indicator {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid var(--border-color);
}

.peak-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
    border: 1px solid var(--border-color);
}

.status-good {
    color: var(--success-color);
    font-weight: 600;
}

.status-moderate {
    color: var(--warning-color);
    font-weight: 600;
}

.status-poor {
    color: var(--danger-color);
    font-weight: 600;
}

.res-good { 
    color: var(--success-color); 
    font-weight: bold; 
}

.res-moderate { 
    color: var(--warning-color); 
    font-weight: bold; 
}

.res-poor { 
    color: var(--danger-color); 
    font-weight: bold; 
}

/* Report Chromatogram */
.report-chromatogram {
    margin: 20px 0;
    text-align: center;
    padding: 20px;
    background: var(--background-section);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.report-chromatogram.compact {
    margin: 10px 0;
    padding: 10px;
    background: var(--background-section);
    border-radius: 4px;
}

.report-chromatogram canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
}

.report-chromatogram.compact canvas {
    border: 1px solid var(--border-color);
    background: white;
}

/* Report Footer */
.report-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.signature-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 30px;
}

.signature-block {
    text-align: center;
}

.signature-line {
    border-bottom: 1px solid #333;
    height: 50px;
    margin-bottom: 8px;
}

.signature-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

.signature-date {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.page-footer {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    padding: 20px 0;
}

.page-footer p {
    margin: 3px 0;
}

/* Compact Report Elements */
.compact-report .report-header-section.compact {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.compact-report h1 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.compact-report .report-meta-compact {
    margin-bottom: 0;
}

.compact-report .meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    font-size: 10px;
}

.compact-report .meta-item {
    display: flex;
    gap: 5px;
    min-width: 0;
    align-items: flex-start;
}

.compact-report .meta-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.compact-report .meta-value {
    color: var(--text-primary);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.compact-report .report-body.compact {
    margin-bottom: 15px;
}

.compact-report .report-section-content.compact {
    margin-bottom: 12px;
    page-break-inside: avoid;
}

.compact-report .report-section-content.compact h2 {
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}

.compact-report .report-section-content.compact h3 {
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--primary-dark);
}

.compact-text {
    font-size: 10px;
    line-height: 1.4;
    margin: 5px 0;
}

.compact-signature-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    page-break-inside: avoid;
    clear: both;
    display: block;
    min-height: 50px;
}

.compact-signature-wrapper {
    margin-top: 25px;
    padding-top: 15px;
    clear: both;
    display: block;
}

.signature-line-box,
.inline-signature {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    font-size: 10px;
    padding: 10px 0;
    margin-top: 10px;
}

.signature-line-box span,
.inline-signature span {
    color: var(--text-secondary);
    flex: 1;
}

.page-break,
.page-break-section {
    page-break-before: always;
    margin-top: 0;
    padding: 0;
    height: 0;
    clear: both;
}

.core-section {
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.extended-section {
    margin-top: 20px;
    clear: both;
}

.extended-section .section-header {
    font-size: 16px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.extended-section h3 {
    font-size: 14px;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.extended-section h4 {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 12px 0 8px 0;
}

.extended-section p {
    font-size: 10px !important;
    line-height: 1.4 !important;
    margin: 5px 0;
}

.model-graph-container {
    margin: 10px 0;
    padding: 10px;
    background: var(--background-section);
    border-radius: 4px;
    text-align: center;
}

.model-graph-container canvas {
    border: 1px solid var(--border-color);
    background: white;
}

.resolution-note {
    font-size: 9px !important;
    color: var(--text-secondary);
    margin-top: 8px;
    padding: 6px;
    background: #ebf8ff;
    border-left: 3px solid var(--primary-color);
    border-radius: 3px;
    line-height: 1.2;
}

.report-table.raw-data {
    font-size: 10px;
}

.report-table.raw-data td {
    padding: 4px 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 9px;
}

.report-footer.compact {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

/* Report Title Area */
.report-title-area {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

.company-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.company-logo img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.title-content {
    flex: 1;
}

.title-content h1 {
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.company-name {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}

.conditions-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    background: var(--background-section);
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: white;
    border-radius: 3px;
    border: 1px solid var(--border-light);
}

.condition-name {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 10px;
}

.condition-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 12px;
    background: var(--background-section);
    padding: 2px 6px;
    border-radius: 2px;
}

.method-notes-section {
    margin-bottom: 25px !important;
    padding-bottom: 15px;
    position: relative;
}

.method-notes-section::after {
    content: '';
    display: block;
    clear: both;
    margin-bottom: 10px;
}

.method-notes-section .compact-text {
    margin-bottom: 25px !important;
    line-height: 1.6 !important;
    display: block !important;
    clear: both !important;
    overflow: visible !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    max-height: none !important;
    height: auto !important;
}

.print-ready {
    display: block;
}

.print-ready + img {
    display: none;
}

/* Settings Tab Styles */
.settings-section {
    height: 100%;
    overflow-y: auto;
}

.settings-header {
    flex-shrink: 0;
}

.settings-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.settings-content {
    display: grid;
    gap: 25px;
}

.settings-category {
    background: var(--background-section);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-light);
}

.settings-category h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.settings-field {
    margin-bottom: 20px;
}

.settings-field label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 13px;
}

.settings-field input,
.settings-field select,
.settings-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.settings-field input:focus,
.settings-field select:focus,
.settings-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

.logo-upload-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo-filename {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

.logo-preview {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-preview img {
    max-width: 200px;
    max-height: 80px;
    object-fit: contain;
}

.settings-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.settings-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.settings-checkbox-group label:hover {
    background: var(--background-card);
}

.settings-checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.settings-status {
    margin-top: 20px;
}

.settings-info-box {
    background: #e7f3ff;
    border-left: 3px solid var(--primary-color);
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.settings-info-box h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 14px;
}

.settings-info-box p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.settings-info-box ul {
    color: var(--text-secondary);
}

.settings-info-box li {
    margin-bottom: 5px;
}

/* Print Media Queries */
@media print {
    .print-ready {
        display: none !important;
    }
    
    .print-ready + img {
        display: block !important;
    }
    
    .company-logo img {
        max-height: 50px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .report-table.compact-conditions-fullwidth th,
    .report-table.compact-conditions-horizontal th {
        background: #f0f0f0 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .report-table.compact-conditions-fullwidth td,
    .report-table.compact-conditions-horizontal td {
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .conditions-horizontal {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding: 8px;
        background: #f9f9f9;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .condition-item {
        display: inline-flex;
        padding: 3px 8px;
        background: white;
        border: 1px solid #ccc;
    }
    
    .condition-name {
        font-weight: 600;
        color: #333;
        font-size: 10px;
    }
    
    .condition-value {
        font-weight: 700;
        color: #000;
        font-size: 10px;
        background: #f0f0f0;
        padding: 1px 5px;
        margin-left: 3px;
    }
    
    .status-good,
    .res-good {
        color: #276749 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .status-moderate,
    .res-moderate {
        color: #b7791f !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .status-poor,
    .res-poor,
    .status-acceptable {
        color: #c53030 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .peak-dot {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .page-break-section {
        page-break-before: always;
    }
    
    .compact-signature-section,
    .model-graph-container,
    .report-chromatogram {
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 1600px) {
    .chromatogram-controls {
        flex-wrap: wrap;
    }
}

@media (max-width: 1400px) {
    .main-layout {
        grid-template-columns: 260px 1fr;
        grid-template-rows: 1fr auto;
    }
    
    .middle-panel {
        grid-column: 2;
        grid-row: 1 / -1;
    }
    
    .right-panel {
        grid-column: 1;
        grid-row: 2;
        max-height: 250px;
    }
    
    .chromatogram-canvas {
        height: 400px !important;
        max-height: 400px !important;
    }
}

@media (max-width: 1200px) {
    .condition-data-section {
        grid-template-columns: 1fr;
    }
    
    .settings-checkbox-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1000px) {
    .main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .left-panel {
        grid-row: 1;
        max-height: 200px;
    }
    
    .middle-panel {
        grid-column: 1;
        grid-row: 2;
    }
    
    .right-panel {
        grid-column: 1;
        grid-row: 3;
        max-height: 180px;
    }
    
    .chromatogram-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .brand-identity {
        width: 100%;
    }
    
    .project-controls-compact {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
    }
    
    .project-info-compact {
        width: 100%;
    }
    
    .project-info-compact input {
        flex: 1;
        width: auto;
    }
    
    .peaks-grid {
        grid-template-columns: 1fr;
    }
    
    .signature-section {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .meta-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .meta-label {
        min-width: auto;
    }
    
    .settings-category {
        padding: 15px;
    }
    
    .logo-upload-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Login Modal Styles */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 18% 20%, rgba(44, 82, 130, 0.14), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(47, 133, 90, 0.12), transparent 30%),
        radial-gradient(circle at 22% 78%, rgba(214, 158, 46, 0.12), transparent 26%),
        linear-gradient(135deg, rgba(44, 82, 130, 0.12), rgba(47, 133, 90, 0.08)),
        var(--background-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    padding: 24px;
    backdrop-filter: blur(4px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-modal {
    background: linear-gradient(180deg, var(--background-card) 0%, #f7fafc 100%);
    border-radius: 12px;
    padding: 32px 32px 28px;
    width: min(460px, 96vw);
    box-shadow: 0 16px 45px rgba(26, 38, 93, 0.15);
    animation: slideUp 0.4s ease;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.login-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

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

.login-header {
    text-align: left;
    margin-bottom: 24px;
}

.login-header .brand-identity {
    justify-content: center;
}

.login-header .brand-mark {
    height: 34px;
}

.login-header h2 {
    color: var(--primary-dark);
    font-size: 22px;
    margin-bottom: 6px;
    font-weight: 700;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 13px;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}

.login-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    min-height: 46px;
    transition: all 0.3s ease;
    background: var(--background-card);
    box-shadow: var(--shadow-sm);
}

.login-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.login-checkbox {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    flex-wrap: nowrap;
}

.login-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.login-checkbox input {
    width: auto;
    height: auto;
    padding: 0;
    margin: 0 6px 0 0;
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.login-checkbox a {
    color: var(--primary-color);
    text-decoration: underline;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.checkbox-inline input {
    margin: 0;
}

.login-error {
    display: none;
    background: #fff5f5;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    border: 1px solid #fed7d7;
    box-shadow: var(--shadow-sm);
}

.login-error.info {
    background: #ebf8ff;
    color: var(--primary-color);
    border-color: #bee3f8;
}

.login-error.success {
    background: #f0fff4;
    color: var(--success-color);
    border-color: #c6f6d5;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    background: var(--background-section);
    padding: 6px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.auth-tab {
    flex: 1;
    background: var(--background-card);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    background: #fff;
    border-color: var(--border-light);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 10px 20px rgba(44, 82, 130, 0.2);
}

.auth-view.hidden {
    display: none;
}

.auth-view button[type="submit"],
#loginForm button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: 1px solid var(--primary-dark);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

.auth-view button[type="submit"]:hover,
#loginForm button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(44, 82, 130, 0.2);
}

.login-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.login-demo-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--background-section);
    padding: 15px;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    box-shadow: var(--shadow-sm);
}

.login-demo-info p {
    margin: 3px 0;
}

.login-demo-info strong {
    color: var(--primary-dark);
}

/* Demo Upgrade Prompt */
.demo-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 18% 20%, rgba(44, 82, 130, 0.14), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(47, 133, 90, 0.12), transparent 30%),
        radial-gradient(circle at 22% 78%, rgba(214, 158, 46, 0.12), transparent 26%),
        linear-gradient(135deg, rgba(44, 82, 130, 0.12), rgba(47, 133, 90, 0.08)),
        var(--background-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
    padding: 24px;
    backdrop-filter: blur(4px);
}

.demo-prompt-modal {
    background: linear-gradient(180deg, var(--background-card) 0%, #f7fafc 100%);
    border-radius: 14px;
    padding: 30px;
    width: min(960px, 96vw);
    max-height: min(90vh, 860px);
    overflow-y: auto;
    box-shadow: 0 16px 45px rgba(26, 38, 93, 0.15);
    animation: slideUp 0.4s ease;
    border: 1px solid var(--border-light);
    position: relative;
}

.demo-prompt-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.demo-prompt-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-light);
}

.demo-prompt-copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(183, 121, 31, 0.12);
    color: var(--warning-color);
    border: 1px solid rgba(183, 121, 31, 0.24);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.demo-prompt-copy h2 {
    color: var(--primary-dark);
    font-size: 28px;
    margin-bottom: 6px;
    font-weight: 700;
}

.demo-prompt-copy p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    max-width: 60ch;
}

.demo-price-panel {
    min-width: 220px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: linear-gradient(135deg, #ebf8ff 0%, #f0fff4 100%);
    box-shadow: var(--shadow-sm);
    text-align: right;
}

.demo-price-label,
.demo-summary-label,
.feature-column-label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.demo-price-panel strong {
    display: block;
    color: var(--primary-dark);
    font-size: 34px;
    line-height: 1;
}

.demo-price-period {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.demo-prompt-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.demo-summary-grid,
.feature-comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.demo-summary-card,
.feature-column {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.demo-summary-card {
    background: var(--background-section);
    padding: 18px;
}

.demo-summary-card.accent {
    background: linear-gradient(135deg, rgba(44, 82, 130, 0.08), rgba(47, 133, 90, 0.08));
}

.demo-summary-card strong {
    display: block;
    color: var(--primary-dark);
    font-size: 17px;
    margin-bottom: 6px;
}

.demo-summary-card p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
}

.feature-column {
    background: linear-gradient(180deg, var(--background-card) 0%, var(--background-section) 100%);
    padding: 20px;
}

.feature-column.demo-features {
    border-top: 4px solid var(--warning-color);
}

.feature-column.pro-features {
    border-top: 4px solid var(--primary-color);
}

.feature-column-header {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.feature-column h3 {
    color: var(--primary-color);
    font-size: 18px;
    margin: 0;
}

.feature-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.feature-column li {
    position: relative;
    padding-left: 24px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.feature-column li::before {
    position: absolute;
    left: 0;
    top: 0.05em;
    font-weight: 700;
}

.feature-column li.available,
.feature-column li.limited {
    color: var(--text-primary);
}

.feature-column li.available::before,
.feature-column li.limited::before {
    content: '✓';
    color: var(--secondary-color);
}

.feature-column li.unavailable {
    color: var(--text-muted);
}

.feature-column li.unavailable::before {
    content: '−';
    color: var(--text-muted);
}

.demo-prompt-actions {
    display: flex;
    gap: 12px;
}

.demo-prompt-actions button {
    flex: 1 1 0;
    min-height: 46px;
    margin-top: 0;
    font-size: 13px;
    letter-spacing: 0.04em;
}

.continue-demo-btn {
    background: var(--background-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.continue-demo-btn:hover {
    background: var(--background-section);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.demo-reminder {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--background-section);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

.demo-reminder input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.demo-reminder label {
    margin: 0;
    font-weight: 600;
}

@media (max-width: 768px) {
    .demo-prompt-overlay {
        padding: 16px;
    }

    .demo-prompt-modal {
        width: min(100%, 96vw);
        padding: 24px 20px 20px;
    }

    .demo-prompt-header,
    .demo-summary-grid,
    .feature-comparison {
        grid-template-columns: 1fr;
    }

    .demo-price-panel {
        min-width: 0;
        text-align: left;
    }

    .demo-prompt-actions {
        flex-direction: column;
    }

    .demo-prompt-actions button {
        width: 100%;
    }

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

@media (max-width: 480px) {
    .demo-prompt-modal {
        padding: 22px 16px 16px;
    }

    .demo-prompt-copy h2 {
        font-size: 22px;
    }

    .feature-column,
    .demo-summary-card {
        padding: 16px;
    }
}

/* User Info Styles in Settings */
.user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.user-info-item {
    display: grid;
    grid-template-columns: minmax(88px, 104px) minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
}

.info-value {
    min-width: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.info-value.demo-mode {
    color: var(--warning-color);
    font-weight: 600;
}

.info-value.license-full {
    color: var(--danger-color);
    font-weight: 600;
}

.username-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.username-input-row input {
    flex: 1;
    width: auto;
}

.username-input-row button {
    white-space: nowrap;
}

.user-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.footer-legal {
    text-align: right;
    margin: 20px 12px 6px;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.8;
}

.user-info-item button.small {
    margin-left: auto;
    padding: 4px 12px;
}

.user-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: var(--background-section);
    border-radius: 4px;
    border: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-indicator span {
    display: block;
    min-width: 0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* License Warning/Actions in Settings */
.license-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid var(--warning-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.warning-icon {
    font-size: 28px;
}

.warning-content strong {
    display: block;
    color: var(--warning-color);
    font-size: 16px;
    margin-bottom: 4px;
}

.warning-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.license-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.license-actions button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
}

.license-reminder {
    flex-basis: 100%;
    font-size: 12px;
    color: var(--warning-color);
    margin-top: 8px;
}

.license-alert {
    flex: 1 100%;
    background: #fed7d7;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--danger-color);
}

.alert-icon {
    font-size: 20px;
}

/* Upgrade Modal Styles */
.upgrade-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.3s ease;
}

.upgrade-modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 30px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-top: 0;
}

.close-modal:hover {
    background: var(--background-section);
    color: var(--text-primary);
}

.pricing-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.pricing-card {
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.recommended {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pricing-card h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.pricing-card .price {
    margin: 20px 0;
}

.pricing-card .amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
}

.pricing-card .period {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 5px;
}

.pricing-card .features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.pricing-card .features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.select-plan {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
}

.guarantee {
    text-align: center;
    padding: 20px;
    background: var(--background-section);
    border-radius: 8px;
    margin-top: 20px;
}

.guarantee p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* License Calculator */
.license-calculator {
    background: var(--background-section);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.quantity-selector {
    margin: 20px 0;
}

.quantity-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-controls button {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 20px;
    font-weight: bold;
}

.quantity-controls input {
    width: 100px;
    height: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

.pricing-summary {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 6px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.price-row.discount {
    color: var(--success-color);
    font-weight: 500;
}

.price-row.total {
    border-top: 2px solid var(--border-color);
    margin-top: 10px;
    padding-top: 15px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.bulk-discount-info {
    margin-top: 20px;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 6px;
}

.bulk-discount-info h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 14px;
}

.bulk-discount-info ul {
    list-style: none;
    padding: 0;
}

.bulk-discount-info li {
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.full-width {
    width: 100%;
}

.simple-modal {
    max-width: 700px;
}

.license-info-content {
    margin: 20px 0;
}

.current-license-info {
    background: var(--background-section);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 25px;
    border-left: 3px solid var(--primary-color);
}

.current-license-info p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.current-license-info strong {
    color: var(--text-primary);
    display: inline-block;
    min-width: 120px;
}

.additional-pricing {
    margin-bottom: 25px;
}

.additional-pricing h3 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.pricing-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.pricing-tier {
    background: var(--background-section);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

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

.pricing-tier.popular {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
}

.pricing-tier.best-value {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
}

.tier-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pricing-tier.best-value .tier-badge {
    background: var(--success-color);
}

.tier-quantity {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.tier-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.tier-price span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.tier-note {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 500;
}

.volume-discount-table {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.volume-discount-table h4 {
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 10px;
}

.volume-discount-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.volume-discount-table th {
    background: var(--background-section);
    color: var(--text-primary);
    padding: 8px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
}

.volume-discount-table td {
    padding: 8px;
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.purchase-instructions {
    background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.instruction-text {
    text-align: center;
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.action-buttons button {
    padding: 12px 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.additional-notes {
    background: var(--background-section);
    border-radius: 6px;
    padding: 15px;
}

.additional-notes h4 {
    color: var(--primary-color);
    font-size: 13px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.additional-notes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.additional-notes li {
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pricing-tiers {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
}

/* Make pricing cards clickable */
.pricing-card.clickable,
.pricing-tier.clickable {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card.clickable:hover,
.pricing-tier.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Add visual feedback for clickable pricing cards */
.pricing-card.clickable::after,
.pricing-tier.clickable::after {
    content: '→';
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--primary-color);
    opacity: 0;
    transition: all 0.3s ease;
}

.pricing-card.clickable:hover::after,
.pricing-tier.clickable:hover::after {
    opacity: 1;
    right: 15px;
}

/* Special styling for the recommended card */
.pricing-card.recommended.clickable:hover {
    border-color: var(--primary-light);
    box-shadow: 0 10px 30px rgba(44, 82, 130, 0.3);
}

/* Special styling for popular and best value tiers */
.pricing-tier.popular.clickable:hover {
    border-color: var(--primary-light);
    box-shadow: 0 8px 25px rgba(44, 82, 130, 0.25);
}

.pricing-tier.best-value.clickable:hover {
    border-color: var(--success-color);
    box-shadow: 0 8px 25px rgba(39, 103, 73, 0.25);
}

/* Ensure buttons inside clickable cards still work */
.pricing-card.clickable button,
.pricing-tier.clickable button {
    position: relative;
    z-index: 2;
}

/* Add hover effect for select plan buttons */
.pricing-card button.select-plan:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Add a subtle "click me" hint on first hover */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(44, 82, 130, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(44, 82, 130, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(44, 82, 130, 0);
    }
}

.pricing-card.clickable:hover,
.pricing-tier.clickable:hover {
    animation: pulse 2s infinite;
}

/* Ensure the entire card area is clickable */
.pricing-card.clickable *,
.pricing-tier.clickable * {
    pointer-events: none;
}

.pricing-card.clickable button,
.pricing-tier.clickable button {
    pointer-events: auto;
}

/* Add tooltip on hover */
.pricing-card.clickable::before,
.pricing-tier.clickable::before {
    content: 'Click to learn more';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.pricing-card.clickable:hover::before,
.pricing-tier.clickable:hover::before {
    opacity: 0.9;
}

/* Method Development Conditions Styles */
.method-dev-note {
    background: #e7f3ff;
    border-left: 3px solid var(--primary-color);
    padding: 10px 15px;
    margin: 15px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    border-radius: 4px;
}

.method-dev-table {
    margin: 20px 0;
}

.method-dev-table th {
    background: var(--primary-dark);
    color: white;
    font-size: 10px;
}

.method-dev-table td {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
}

.method-dev-table td.target-value {
    background: #e7f3ff;
    color: var(--primary-color);
    font-weight: 700;
}

.method-dev-table td.varied-value {
    background: #fff3cd;
    color: var(--warning-color);
    font-weight: 700;
}

.method-dev-instructions {
    background: var(--background-section);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.method-dev-instructions h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 14px;
}

.method-dev-instructions ol {
    margin: 15px 0 15px 20px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.method-dev-instructions li {
    margin-bottom: 8px;
}

.method-dev-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-secondary);
}

.method-dev-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.target-indicator,
.varied-indicator {
    display: inline-block;
    width: 20px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid var(--border-color);
}

.target-indicator {
    background: #e7f3ff;
}

.varied-indicator {
    background: #fff3cd;
}

/* Print styles for method development section */
@media print {
    .method-dev-table td.target-value {
        background: #e7f3ff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .method-dev-table td.varied-value {
        background: #fff3cd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .method-dev-note {
        background: #f0f8ff !important;
        border-left: 2px solid #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .method-dev-instructions {
        page-break-inside: avoid;
    }
}

/* Method Development Options Styles */
.method-dev-options {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.method-dev-options .variation-selection,
.method-dev-options .runs-selection {
    margin-bottom: 15px;
}

.method-dev-options .section-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    font-size: 13px;
}

.method-dev-options label {
    display: block;
    margin: 5px 0;
    padding-left: 20px;
    font-size: 13px;
}

.method-dev-options input[type="checkbox"],
.method-dev-options input[type="radio"] {
    margin-right: 8px;
    margin-left: -20px;
}

.design-summary {
    background: #e7f3ff;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.design-summary h4 {
    margin-top: 0;
    color: #2c5282;
    font-size: 14px;
}

.summary-details p {
    margin: 8px 0;
    font-size: 12px;
    line-height: 1.5;
}

.design-note {
    font-style: italic;
    color: #6c757d;
    margin-top: 10px !important;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

/* Highlight reduced experiments in the table */
.method-dev-table tr.reduced-experiment {
    background-color: #fff3cd;
}

.method-dev-table tr.reduced-experiment td {
    font-style: italic;
}

.screening-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px;
    margin: 10px 0;
    font-style: italic;
    border-radius: 4px;
}

.method-dev-table tr.screening-experiment {
    background-color: #fff8e1;
    font-weight: bold;
}

.method-dev-table tr.baseline-experiment {
    background-color: #e8f5e8;
    font-weight: bold;
}

.screening-indicator {
    background: #ffc107 !important;
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-right: 5px;
    border-radius: 2px;
}

/* 50% Variation Warning Styles */
.variation-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px;
    margin: 10px 0;
    font-size: 12px;
    color: #856404;
}

.method-dev-options label[for="include50Percent"] {
    color: #856404;
    font-weight: 500;
}

.method-dev-options #include50Percent:checked + label {
    background-color: #fff3cd;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Highlight extreme variations in table */
.method-dev-table td.varied-value.extreme-variation {
    background-color: #fff3cd !important;
    font-weight: bold;
}


/* Method Development Options Enhanced Styling */
.method-dev-options {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.method-dev-options .variation-selection,
.method-dev-options .runs-selection {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.method-dev-options .runs-selection {
    border-bottom: none;
    margin-bottom: 15px;
}

.method-dev-options .section-label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #495057;
    font-size: 14px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 4px;
}

/* Checkbox Grid Layout */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-left: 0;
}

.checkbox-item {
    display: flex !important;
    align-items: flex-start;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 !important;
}

.checkbox-item:hover {
    background: #e7f3ff;
    border-color: #3498db;
}

.checkbox-item input[type="checkbox"] {
    margin: 0 12px 0 0 !important;
    transform: scale(1.1);
}

.checkbox-text {
    font-size: 13px;
    line-height: 1.4;
    color: #495057;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.checkbox-text small {
    color: #6c757d;
    font-style: italic;
    margin-top: 2px;
}

/* Radio Group Layout */
.radio-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-left: 0;
}

.radio-item {
    display: flex !important;
    align-items: flex-start;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 !important;
}

.radio-item:hover {
    background: #e7f3ff;
    border-color: #3498db;
}

.radio-item input[type="radio"] {
    margin: 0 12px 0 0 !important;
    transform: scale(1.1);
}

.radio-text {
    font-size: 13px;
    line-height: 1.4;
    color: #495057;
    flex: 1;
}

/* Method Dev Preview */
.method-dev-preview {
    margin-top: 15px;
    padding: 15px;
    background: #e8f4f8;
    border-left: 4px solid #17a2b8;
    border-radius: 0 6px 6px 0;
}

.preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-text {
    font-size: 12px;
    color: #495057;
    font-style: italic;
}

/* Enhanced Report Options */
.report-options {
    margin-top: 20px;
}

.report-options h4 {
    margin: 20px 0 15px 0;
    color: #495057;
    font-size: 16px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

.report-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.report-checkbox-group label {
    display: flex !important;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 !important;
}

.report-checkbox-group label:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.report-checkbox-group input[type="checkbox"] {
    margin: 0 10px 0 0 !important;
    transform: scale(1.1);
}

/* Additional styles for method development elements */
.screening-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin: 15px 0;
    font-style: italic;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    line-height: 1.4;
}

.design-summary {
    background: #e7f3ff;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.design-summary h4 {
    margin-top: 0;
    color: #2c5282;
    font-size: 14px;
}

.summary-details p {
    margin: 8px 0;
    font-size: 12px;
    line-height: 1.5;
}

.design-note {
    font-style: italic;
    color: #6c757d;
    margin-top: 10px !important;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

/* Print-specific method development styles */
.method-dev-table tr.reduced-experiment {
    background-color: #fff3cd !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.method-dev-table tr.screening-experiment {
    background-color: #fff8e1 !important;
    font-weight: bold;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.method-dev-table tr.baseline-experiment {
    background-color: #e8f5e8 !important;
    font-weight: bold;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.target-indicator,
.varied-indicator,
.screening-indicator {
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-right: 5px;
    border-radius: 2px;
    vertical-align: middle;
}

.target-indicator {
    background: #28a745 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.varied-indicator {
    background: #ffc107 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.screening-indicator {
    background: #fd7e14 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Data collection table styles */
.data-collection-table {
    font-size: 10px !important;
    margin: 15px 0;
    page-break-inside: avoid;
}

.data-collection-table th {
    background: #f0f0f0 !important;
    color: #000 !important;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #ccc;
    font-weight: 600;
    font-size: 9px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.data-collection-table td {
    padding: 10px 8px;
    border: 1px solid #ccc;
    text-align: center;
    font-size: 10px !important;
}

.data-collection-table .data-entry-cell {
    background: #f9f9f9 !important;
    min-height: 25px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.data-collection-notes {
    margin-top: 20px;
    page-break-inside: avoid;
}

.data-collection-notes h4 {
    color: #2c5282;
    margin-bottom: 10px;
    font-size: 12px !important;
}

.data-collection-notes ol {
    margin: 10px 0 10px 20px;
    font-size: 11px !important;
    line-height: 1.6;
    color: #495057;
}

.data-collection-notes li {
    margin-bottom: 6px;
    font-size: 11px !important;
}

.notes-section {
    margin-top: 20px;
    page-break-inside: avoid;
}

.notes-lines {
    margin-top: 10px;
}

.note-line {
    margin: 15px 0;
    font-size: 10px;
    color: #999;
    border-bottom: 1px solid #ccc;
    padding-bottom: 2px;
}

.analyst-verification {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #333;
    page-break-inside: avoid;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .checkbox-grid,
    .radio-group {
        grid-template-columns: 1fr;
    }
    
    .method-dev-options {
        padding: 15px;
        margin-top: 15px;
    }
    
    .report-checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* Admin Dashboard */
.admin-body {
    background: var(--background-app);
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text-primary);
}

.admin-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px 40px;
}

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

.admin-title h1 {
    margin: 0;
    font-size: 28px;
    color: var(--primary-color);
}

.admin-subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary);
}

.admin-actions button {
    margin-left: 10px;
}

.admin-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.summary-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    margin-bottom: 30px;
}

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

.panel-header h2 {
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 10px;
}

.panel-actions input[type="search"] {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    min-width: 220px;
}

.table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.admin-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    background: var(--background-section);
}

.table-placeholder {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.table-placeholder.error {
    color: var(--danger-color);
}

.user-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-cell strong {
    font-weight: 600;
}

.user-cell span {
    font-size: 13px;
    color: var(--text-secondary);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 6px;
    text-transform: uppercase;
}

.badge.admin-badge {
    background: rgba(44, 82, 130, 0.15);
    color: var(--primary-color);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.18);
    color: #b7791f;
}

.license-type {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.license-max {
    width: 80px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.usage-indicator {
    font-weight: 600;
}

.action-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form select,
.inline-form button {
    height: 38px;
}

.reset-output {
    margin-top: 15px;
}

.token-card {
    background: var(--background-section);
    border-radius: 8px;
    padding: 14px;
    border: 1px dashed var(--border-color);
}

.token-card code {
    background: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.token-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

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

    .panel-actions {
        width: 100%;
        flex-direction: column;
    }

    .panel-actions input[type="search"] {
        width: 100%;
    }

    .admin-table th,
    .admin-table td {
        font-size: 12px;
        padding: 10px;
    }
}

/* ============================================================
   RESPONSIVE DESIGN OVERHAUL - Mobile & Tablet
   ============================================================ */

/* ------------------------------------------------------------
   Tablet (max-width: 768px) - Additions
   ------------------------------------------------------------ */
@media (max-width: 768px) {
    /* Make sure main layout stacks */
    .main-layout { display: flex !important; flex-direction: column !important; }
    .left-panel, .middle-panel, .right-panel { max-height: none !important; width: 100% !important; }

    /* Data tables scrollable */
    .data-table-container, .peak-data-section table { display: block; overflow-x: auto; }

    /* All form inputs full width */
    input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select { width: 100%; }

    /* Report checkboxes stack */
    .report-checkboxes { grid-template-columns: 1fr 1fr !important; }

    /* Settings account info */
    .account-info-grid { grid-template-columns: 1fr 1fr !important; }

    /* Marketing page responsive */
    .hero-section, .hero, [class*="hero-grid"] { flex-direction: column !important; }
    .hero-grid { grid-template-columns: 1fr !important; }
    .hero, [class*="hero"] { min-height: auto !important; }
    .hero-content, .hero-pricing, .hero-grid > * { width: 100% !important; max-width: 100% !important; }
    .grid-3, .features-grid, [class*="feature"] { grid-template-columns: 1fr !important; }
    .split, .split-section, [class*="split"] { grid-template-columns: 1fr !important; flex-direction: column !important; }
    .cta, .cta-section, [class*="cta"] { padding: 30px 15px !important; }

    /* Marketing reveal fix - ensure content is visible on mobile */
    .page .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Admin responsive */
    .admin-container { padding: 8px; }
    .admin-header { flex-direction: column; gap: 10px; }
    .admin-summary { flex-direction: column; }
    .summary-card { width: 100%; }

    /* Admin tables: handled by card layout below 768px */
    .admin-actions button { padding: 4px 8px; font-size: 11px; min-height: 32px; }

    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    .inline-form { flex-direction: column; }
    .inline-form select { width: 100%; }
}

/* ------------------------------------------------------------
   Mobile (max-width: 480px)
   ------------------------------------------------------------ */
@media (max-width: 480px) {
    body { padding: 4px; }
    .container { padding: 6px; border-radius: 0; }

    /* Header: stack everything vertically */
    .header-container { flex-direction: column; align-items: stretch; gap: 8px; padding-bottom: 8px; }
    .header-container h1 { font-size: 18px; }
    .brand-identity { gap: 6px; }
    .brand-mark { height: 28px; }
    .app-subtitle { font-size: 10px; }

    /* Project controls: compact */
    .project-controls-compact { flex-direction: column; width: 100%; gap: 6px; }
    .project-info-compact { width: 100%; }
    .project-info-compact input { width: 100%; }
    .project-buttons-compact { gap: 2px; }
    .project-buttons-compact button { padding: 4px 6px; font-size: 14px; min-width: 34px; min-height: 34px; }
    .user-indicator { font-size: 11px; flex-wrap: wrap; gap: 4px; }
    .user-indicator span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Tabs: horizontal scroll */
    .tabs { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 0; flex-wrap: nowrap; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-button { white-space: nowrap; flex-shrink: 0; padding: 8px 12px; font-size: 12px; min-height: 44px; }

    /* Overview: single column */
    .main-layout { display: flex !important; flex-direction: column !important; gap: 12px; }
    .left-panel, .middle-panel, .right-panel { max-height: none !important; overflow: visible !important; width: 100% !important; }
    .left-panel { order: 1; }
    .middle-panel { order: 2; }
    .right-panel { order: 3; }

    /* Canvas responsive */
    .chromatogram-canvas { height: 250px !important; max-height: 250px !important; }

    /* Chromatogram controls */
    .chromatogram-controls { flex-direction: column; gap: 6px; }
    .control-group { flex-direction: column; gap: 4px; }
    .view-mode-buttons { flex-wrap: wrap; }
    .view-mode-buttons button { min-height: 36px; padding: 6px 10px; }

    /* Legend */
    .chromatogram-legend { flex-direction: column; font-size: 11px; gap: 4px; }

    /* Target conditions */
    .target-conditions-container { flex-direction: column; }
    .target-condition-group { width: 100%; }

    /* Initial conditions */
    .initial-condition-group { flex-direction: column; }

    /* Data tables */
    .data-table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 400px; }

    /* Peak cards */
    .peak-card { padding: 10px; }
    .peak-properties { flex-direction: column; }
    .peak-property { width: 100%; }

    /* Condition data section */
    .condition-data-section { grid-template-columns: 1fr !important; }
    .condition-tabs { flex-wrap: wrap; }

    /* Report form */
    .report-form .form-group { width: 100%; }
    .report-checkboxes, .settings-checkbox-group { grid-template-columns: 1fr !important; }

    /* Settings */
    .settings-header-buttons { flex-wrap: wrap; gap: 4px; }
    .settings-header-buttons button { font-size: 11px; padding: 6px 10px; min-height: 36px; }
    .settings-grid { grid-template-columns: 1fr !important; }
    .account-info-grid { grid-template-columns: 1fr !important; }
    .user-account-actions { flex-wrap: wrap; }
    .user-account-actions button { flex: 1 1 auto; min-height: 44px; }

    /* Touch targets - minimum 44px */
    button, .tab-button, input[type="checkbox"], input[type="radio"] { min-height: 44px; }
    input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
    select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea { min-height: 44px; font-size: 16px; } /* 16px prevents iOS zoom */

    /* Project status */
    .project-status { font-size: 10px; }

    /* Resolution section */
    .resolution-section { font-size: 13px; }

    /* Quick multi-condition entry */
    .multi-condition-form { flex-direction: column; }
    .multi-condition-inputs { flex-direction: column; }

    /* Admin mobile */
    .admin-header h1 { font-size: 18px; }
    .summary-card { padding: 12px; }
    .summary-card .summary-value { font-size: 24px; }
}

/* ============================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================ */

/* Restore focus outlines - WCAG 2.4.7 */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible, .tab-button:focus-visible, a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 3px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

/* Remove any existing outline:none declarations won't work since they have equal specificity,
   so we use !important on focus-visible */
*:focus-visible {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

/* ============================================================
   IMPROVEMENT PLAN 2 — Layout Fixes & Professional Polish
   ============================================================ */

/* --- H7: Fix chromatogram controls layout on mobile/tablet --- */
@media (max-width: 768px) {
    .chromatogram-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .chromatogram-controls-left {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .chromatogram-controls-left .control-group {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .chromatogram-controls select {
        max-width: 120px;
    }

    .chromatogram-controls input[type="number"] {
        width: 50px;
        min-height: 36px;
    }

    .chromatogram-controls-right .toggle-controls {
        display: flex;
        align-items: center;
        gap: 6px;
        justify-content: flex-start;
    }
}

/* --- H8: Tab bar clips on mobile — make scrollable --- */
@media (max-width: 600px) {
    .tabs {
        position: relative;
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }
    .tabs::-webkit-scrollbar { display: none; }

    /* Fade hint on right edge */
    .tabs::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, var(--background-card));
        pointer-events: none;
        flex-shrink: 0;
    }

    .tab-button {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 11px;
        letter-spacing: 0.3px;
    }
}

/* --- H9: Admin tables — horizontal scroll with hint on mobile --- */
@media (max-width: 768px) {
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-wrapper table.admin-table {
        min-width: 700px;
    }
    /* Visual scroll hint */
    .table-wrapper::after {
        content: '\2190 scroll \2192';
        display: block;
        text-align: center;
        font-size: 11px;
        color: var(--text-muted);
        padding: 4px;
    }
}

/* --- H10: Admin Actions hidden on tablet — enable horizontal scroll --- */
@media (max-width: 1024px) {
    .table-wrapper {
        overflow-x: auto;
    }
    .admin-panel {
        overflow-x: auto;
    }
}

/* --- M1: Details table overflows right panel on desktop --- */
.right-panel table {
    font-size: 11px;
}
.right-panel {
    overflow-x: auto;
}
.right-panel th {
    white-space: nowrap;
    font-size: 10px;
}

/* --- M2: Peak data tables on mobile --- */
@media (max-width: 600px) {
    .peak-data-section { overflow-x: auto; }
    .peak-data-section table { min-width: 350px; }
}

/* --- M3: Report preview on mobile --- */
@media (max-width: 600px) {
    .report-preview { overflow-x: auto; }
    .report-preview table { min-width: 400px; }
}

/* --- M4: Tab header actions stack on mobile --- */
@media (max-width: 600px) {
    .tab-panel {
        padding: 8px 14px 14px;
    }

    .tab-panel-header {
        padding: 9px 12px;
        margin-bottom: 14px;
        align-items: flex-start;
    }

    .tab-panel-header h2 {
        font-size: 1.02rem;
    }

    .peaks-control-buttons,
    .report-actions,
    .settings-actions {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    .conditions-header button,
    .peaks-control-buttons button,
    .report-actions button,
    .settings-actions button {
        width: 100%;
        text-align: center;
    }
}

/* --- L2: Tablet 2-column layout --- */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-layout {
        display: grid !important;
        grid-template-columns: 240px 1fr !important;
        grid-template-rows: 1fr auto !important;
        flex-direction: unset !important;
    }
    .left-panel { grid-column: 1; grid-row: 1; max-height: none !important; }
    .middle-panel { grid-column: 2; grid-row: 1 / -1; }
    .right-panel { grid-column: 1; grid-row: 2; max-height: 250px !important; }
}

/* --- Professional Typography Refinements --- */
h2, h3, h4 {
    letter-spacing: -0.3px;
}

/* --- Subtle section dividers & hover effects --- */
.section, .peak-card, .settings-category {
    transition: box-shadow 0.2s ease;
}
.peak-card:hover {
    box-shadow: var(--shadow-md);
}

/* --- Better button interactions --- */
button, .tab-button {
    transition: all 0.15s ease;
}
button:active {
    transform: scale(0.97);
}

/* --- Smoother tab content transitions --- */
.tab-content {
    animation: fadeIn 0.15s ease;
}

/* --- Status badge refinement --- */
.project-status {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* --- Better form focus states --- */
input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

/* --- Refined scrollbars for horizontal-scroll areas --- */
.tabs::-webkit-scrollbar,
.data-table-container::-webkit-scrollbar {
    height: 4px;
}
.tabs::-webkit-scrollbar-thumb,
.data-table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* --- Admin summary cards hover refinement --- */
.summary-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================================
   CHROMATOGRAM CONTROLS — Mobile/Tablet Fix (override)
   ============================================================ */
@media (max-width: 768px) {
    .chromatogram-controls {
        flex-wrap: wrap !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        padding: 6px 8px;
    }

    /* View + Scale on one compact row */
    .chromatogram-controls-left {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        flex: 1;
        min-width: 0;
    }

    .chromatogram-controls-left .control-group {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 3px !important;
        flex-wrap: nowrap !important;
    }

    .chromatogram-controls-left label {
        font-size: 10px !important;
        white-space: nowrap;
    }

    .chromatogram-controls-left select {
        max-width: 100px !important;
        min-height: 32px;
        font-size: 12px;
        padding: 2px 4px;
    }

    .chromatogram-controls-left input[type="number"] {
        width: 42px !important;
        min-height: 32px !important;
        font-size: 12px;
        padding: 2px 4px;
    }

    .chromatogram-controls-left .control-group span {
        font-size: 11px;
    }

    /* Overlay/Compare/Initial on second row */
    .chromatogram-controls-right {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
        margin-left: 0 !important;
        width: 100%;
        justify-content: flex-end;
    }

    .toggle-controls {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
    }

    .toggle-controls button {
        padding: 4px 10px !important;
        font-size: 11px !important;
        min-height: 32px;
    }

    .checkbox-control {
        display: flex;
        align-items: center;
        gap: 3px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .chromatogram-controls-left select {
        max-width: 85px !important;
    }

    .chromatogram-controls-left input[type="number"] {
        width: 38px !important;
    }
}

/* Chromatogram preview builder integration */
.header-container h1 {
    letter-spacing: 0;
}

.chromatogram-container {
    min-height: 620px;
    overflow-x: hidden;
    overflow-y: auto;
}

.chromatogram-toolbar {
    display: grid;
    gap: 5px;
    margin-bottom: 6px;
    flex: 0 0 auto;
}

.chromatogram-toolbar .chromatogram-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 0;
    padding: 5px 8px;
}

.chromatogram-settings {
    border: 1px solid var(--border-light);
    border-radius: 3px;
    background: var(--background-card);
    box-shadow: var(--shadow-sm);
}

.chromatogram-settings summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 8px;
    color: var(--primary-color);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.chromatogram-settings summary::-webkit-details-marker {
    display: none;
}

.chromatogram-settings summary::before {
    content: '›';
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.chromatogram-settings[open] summary {
    border-bottom: 1px solid var(--border-light);
}

.chromatogram-settings[open] summary::before {
    transform: rotate(90deg);
}

.chromatogram-settings-content {
    display: grid;
    gap: 5px;
    padding: 5px;
}

.chromatogram-settings-content .chromatogram-controls {
    box-shadow: none;
}

.chromatogram-toolbar .control-group {
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.chromatogram-toolbar .control-group-wide input[type="range"] {
    width: 92px;
}

.chromatogram-toolbar input[type="range"] {
    accent-color: var(--secondary-color);
    cursor: pointer;
}

.chromatogram-toolbar input[type="color"] {
    width: 28px;
    height: 26px;
    padding: 1px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: white;
    cursor: pointer;
}

.chromatogram-toolbar .checkbox-control {
    cursor: pointer;
}

.chromatogram-toolbar .checkbox-control input {
    accent-color: var(--secondary-color);
}

.chromatogram-toolbar button {
    margin: 0;
}

.chromatogram-toolbar .toggle-controls button {
    margin: 0;
}

.chromatogram-toolbar .icon-control {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.chromatogram-toolbar .noise-seed {
    min-width: 36px;
    color: var(--text-muted);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
}

#mergeControls[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.chromatogram-canvas-wrap {
    flex: 0 0 auto;
    min-height: 0;
    padding: 5px;
    overflow: hidden;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.chromatogram-canvas-wrap .chromatogram-canvas {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border: 0;
    border-radius: 3px;
    box-shadow: none;
}

@media (max-width: 1000px) {
    .chromatogram-toolbar .chromatogram-controls {
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .header-container h1 {
        font-size: 19px;
        overflow-wrap: anywhere;
    }

    .chromatogram-container {
        min-height: 540px;
        overflow: visible;
    }

    .chromatogram-toolbar .chromatogram-controls {
        justify-content: flex-start;
    }

    .chromatogram-toolbar .control-group {
        flex-direction: row !important;
        align-items: center !important;
    }

    .chromatogram-toolbar .control-group-wide {
        flex: 1 1 220px;
    }

    .chromatogram-toolbar .control-group-wide input[type="range"] {
        flex: 1;
        min-width: 72px;
    }

    .chromatogram-toolbar .custom-range-controls {
        flex-wrap: nowrap;
    }

    .resolution-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .right-panel,
    .right-panel .results-panel,
    .right-panel .results-content {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* ============================================================
   ADMIN PAGE — Mobile Card Layout (replaces broken table)
   ============================================================ */
@media (max-width: 768px) {
    /* Hide table header */
    .admin-table thead {
        display: none !important;
    }

    .admin-table,
    .admin-table tbody {
        display: block !important;
        width: 100% !important;
    }

    /* Each row becomes a card */
    .admin-table tbody tr {
        display: block !important;
        padding: 14px;
        margin-bottom: 10px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--background-card);
        box-shadow: var(--shadow-sm);
    }

    /* Each cell becomes a block row */
    .admin-table tbody td {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 5px 0 !important;
        border: none !important;
        border-bottom: 1px solid var(--border-light);
        font-size: 13px;
        min-height: auto;
        gap: 8px;
    }

    .admin-table tbody td:last-child {
        border-bottom: none;
        padding-top: 10px !important;
    }

    /* User info cell — full width, no label */
    .admin-table tbody td:first-child {
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 10px !important;
        margin-bottom: 4px;
    }

    .admin-table tbody td:first-child .user-cell {
        width: 100%;
    }

    /* Add labels via nth-child — USER DIRECTORY table only */
    #usersTableBody td:nth-child(2)::before { content: 'Role'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #usersTableBody td:nth-child(3)::before { content: 'License'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #usersTableBody td:nth-child(4)::before { content: 'Seats'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #usersTableBody td:nth-child(5)::before { content: 'Usage'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #usersTableBody td:nth-child(6)::before { content: 'Marketing'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #usersTableBody td:nth-child(7)::before { content: 'Last Login'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #usersTableBody td:nth-child(8)::before { content: 'Last Logout'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }

    /* Session tables — labels for their column structure */
    #sessionsTableBody td:nth-child(2)::before { content: 'License'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #sessionsTableBody td:nth-child(3)::before { content: 'Created'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #sessionsTableBody td:nth-child(4)::before { content: 'Last Seen'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #sessionsTableBody td:nth-child(5)::before { content: 'Heartbeat'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }
    #sessionsTableBody td:nth-child(6)::before { content: 'Expires'; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-muted); min-width: 80px; }

    /* Actions row — wrap buttons */
    .admin-table tbody td:last-child .action-group {
        display: flex !important;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        justify-content: flex-end;
    }

    .admin-table tbody td:last-child .action-group button {
        flex: 1 1 auto;
        min-width: 60px;
        text-align: center;
    }

    /* Dropdowns and inputs in cards — reasonable size */
    .admin-table select {
        min-width: 80px;
        max-width: 120px;
    }

    .admin-table input[type="number"] {
        width: 60px;
    }

    /* Panel header stack on mobile */
    .panel-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px;
    }

    .panel-header h2 {
        font-size: 20px;
    }

    .panel-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .panel-actions input[type="search"] {
        width: 100%;
    }

    /* Session tables — also card layout */
    .admin-panel .table-wrapper {
        overflow-x: visible !important;
    }
}

/* ============================================================
   IMPROVEMENT PLAN 3 — Fixes
   ============================================================ */

/* H3: Retention Time Results panel sizing */
.right-panel .results-table,
.right-panel table {
    font-size: 10px !important;
    width: 100%;
}
.right-panel .results-table th,
.right-panel table th {
    font-size: 9px !important;
    padding: 4px 3px !important;
    white-space: nowrap;
}
.right-panel .results-table td,
.right-panel table td {
    padding: 4px 3px !important;
    font-size: 10px !important;
}
.right-panel {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

@media (min-width: 769px) and (max-width: 1400px) {
    #overview-tab .right-panel {
        overflow-y: hidden !important;
    }
}

@media (min-width: 1401px) {
    .container[data-active-tab="overview"] .right-panel {
        overflow-y: hidden !important;
    }
}

/* H4: Mobile tabs — ensure scrollability and visual hint */
@media (max-width: 600px) {
    .tabs {
        position: relative;
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        padding-right: 30px; /* space for fade */
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-button {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 8px 12px !important;
        font-size: 11px !important;
        min-width: auto !important;
    }
}

/* H5: Retention Time Results table on mobile — horizontal scroll */
@media (max-width: 600px) {
    .right-panel table,
    .results-section table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .right-panel table th,
    .right-panel table td {
        font-size: 10px !important;
        padding: 3px 4px !important;
    }
}

/* H6: Admin card layout — reinforce with !important */
@media (max-width: 768px) {
    .admin-table thead { display: none !important; }
    .admin-table, .admin-table tbody { display: block !important; width: 100% !important; }
    .admin-table tbody tr {
        display: block !important;
        padding: 14px !important;
        margin-bottom: 10px !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        background: var(--background-card) !important;
        box-shadow: var(--shadow-sm) !important;
    }
    .admin-table tbody td {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 5px 0 !important;
        border: none !important;
        border-bottom: 1px solid var(--border-light) !important;
        font-size: 13px !important;
    }
}

/* M3: Wider project name input */
.project-info-compact input[type="text"],
.project-info-compact input {
    min-width: 200px;
    flex: 1 1 auto;
}

/* M8: Compact mobile toolbar */
@media (max-width: 480px) {
    .project-buttons-compact {
        gap: 1px !important;
    }
    .project-buttons-compact button {
        padding: 3px 5px !important;
        font-size: 13px !important;
        min-width: 30px !important;
        min-height: 30px !important;
    }
    .user-indicator {
        font-size: 10px !important;
    }
}

/* L2: Even peak card grid */
.peaks-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
}

/* Full retention-time labels in compact results and reports */
.results-controls {
    align-items: flex-start;
}

.results-controls h2 {
    min-width: 0;
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.results-checkbox-control {
    flex: 0 0 auto;
}

#resultsTable {
    display: table !important;
    table-layout: fixed;
}

#resultsTable th,
#resultsTable td {
    min-width: 0 !important;
}

#resultsTable th {
    padding: 5px 3px !important;
    white-space: normal !important;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.15;
    vertical-align: middle;
}

#resultsTable th:first-child,
#resultsTable td:first-child {
    width: 30%;
}

#resultsTable th:nth-child(2),
#resultsTable td:nth-child(2),
#resultsTable th:nth-child(3),
#resultsTable td:nth-child(3) {
    width: 35%;
    text-align: center;
}

.report-table th {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.2;
}
