body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
header {
    background-color: #6796c5;
    color: white;
    padding: 20px 0;
    margin-bottom: 20px;
}
header h1 {
    margin: 0;
    padding: 0 20px;
    text-align: center;
}
.panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    padding: 20px;
}
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}
.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    transition: all 0.3s ease;
}
.tab.active {
    background-color: white;
    border-color: #ddd;
    color: #6796c5;
    font-weight: bold;
}
.tab:hover:not(.active) {
    background-color: #f1f1f1;
}
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}
.control-group {
    display: flex;
    flex-direction: column;
}
label {
    font-weight: bold;
    margin-bottom: 5px;
}
select, button, input {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
}
select[multiple] {
    height: 150px;
}
button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
button:hover {
    background-color: #2980b9;
}
.chart-container {
    height: 400px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: height 0.3s ease;
    position: relative;
}
.empty-chart-message {
    text-align: center;
    color: #888;
    font-size: 16px;
    padding: 30px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    width: 80%;
    background-color: #f9f9f9;
    display: none;
}
.chart-container.empty .empty-chart-message {
    display: block;
}
.chart-container.empty canvas {
    display: none;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
th {
    background-color: #f2f2f2;
    font-weight: bold;
}
.card {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 15px;
}
.card h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    color: #6796c5;
}
.file-input-container {
    margin-bottom: 20px;
}

.file-input-wrapper {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Add styles for the drag-and-drop zone */
#dropZone {
    border: 2px dashed #ccc;
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#dropZone.dragover {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

.dark-theme #dropZone {
    border-color: #555;
}

.dark-theme #dropZone.dragover {
    border-color: #4fc3f7;
    background-color: rgba(79, 195, 247, 0.1);
}

/* Hide the actual file input */
#fileInput {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-input-label {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.file-input-label:hover {
    background-color: #2980b9;
}

.file-status {
    margin-left: 10px;
    font-size: 14px;
    color: #666;
}

.progress-container {
    width: 100%;
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s ease;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 4px;
    border-left: 4px solid;
    background-color: #f8f9fa;
}

.alert.info {
    border-left-color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

.chart-height-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 300px;
    z-index: 1000;
}

.notification {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    margin-bottom: 10px;
    transform: translateX(120%);
    animation: slide-in 0.3s forwards;
    position: relative;
    border-left: 4px solid;
}

.notification.success {
    border-left-color: #2ecc71;
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification.info {
    border-left-color: #3498db;
}

.notification.warning {
    border-left-color: #f39c12;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    cursor: pointer;
    font-size: 18px;
    color: #aaa;
}

@keyframes slide-in {
    100% { transform: translateX(0%); }
}

@keyframes slide-out {
    0% { transform: translateX(0%); }
    100% { transform: translateX(120%); opacity: 0; }
}

.control-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 14px;
}
.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}
.toggle-button {
    padding: 5px 10px;
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}
.toggle-button.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}
.hidden {
    display: none !important;
}
.result-panel {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}
.dataset-list {
    margin-bottom: 10px;
}
.dataset-list li {
    line-height: 1.5;
}
@media (max-width: 768px) {
    .controls {
    flex-direction: column;
    align-items: stretch;
    }
    .toggle-group {
    flex-direction: column;
    }
}

/* Enhanced styles for better visualization */
.enhanced-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.enhanced-table th, .enhanced-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.enhanced-table th {
    background-color: #6796c5;
    color: white;
    font-weight: bold;
}

.enhanced-table tr:hover {
    background-color: #f5f5f5;
}

.enhanced-table td {
    transition: background-color 0.2s;
}

.enhanced-table td.highlight {
    background-color: #d4f0fd;
}

.stats-visualization-container {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 400px;
}

.chart-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-preview {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.priority-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.priority-control button {
    padding: 4px 8px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.secondary-button {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}

.secondary-button:hover {
    background-color: #e1e1e1;
}

.test-interpretation {
    background-color: #f8f9fa;
    border-left: 3px solid #3498db;
    padding: 10px 15px;
    margin-top: 10px;
}

.effect-size-indicator {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: bold;
    margin-left: 5px;
}

.effect-size-small {
    background-color: #d1f3e0;
    color: #2c7a51;
}

.effect-size-medium {
    background-color: #ffeeba;
    color: #856404;
}

.effect-size-large {
    background-color: #f8d7da;
    color: #721c24;
}

.dataset-order-list {
    list-style-type: none;
    padding: 0;
    margin: 15px 0;
}

.dataset-order-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
}

.dataset-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.dataset-order-controls {
    margin-left: auto;
    display: flex;
    gap: 5px;
}

/* Dark Theme Styles */
.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-theme header {
    background-color: #1e1e1e;
}

.dark-theme .panel,
.dark-theme .card,
.dark-theme select,
.dark-theme input,
.dark-theme .dataset-order-item {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

.dark-theme .tab {
    color: #e0e0e0;
}

.dark-theme .tab.active {
    background-color: #2d2d2d;
    color: #4fc3f7;
    border-color: #444;
}

.dark-theme .tab:hover:not(.active) {
    background-color: #3d3d3d;
}

.dark-theme .toggle-button {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

.dark-theme .toggle-button.active {
    background-color: #4fc3f7;
    color: #121212;
    border-color: #4fc3f7;
}

.dark-theme .secondary-button {
    background-color: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

.dark-theme .secondary-button:hover {
    background-color: #4d4d4d;
}

.dark-theme th {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.dark-theme th, 
.dark-theme td {
    border-color: #444;
}

.dark-theme .enhanced-table tr:hover {
    background-color: #3d3d3d;
}

.dark-theme .enhanced-table td.highlight {
    background-color: #1e466e;
}

.dark-theme .alert.info {
    background-color: rgba(52, 152, 219, 0.2);
}

.dark-theme pre {
    background-color: #1e1e1e;
}

.dark-theme .result-panel {
    background-color: #1e1e1e;
}

.dark-theme .test-interpretation {
    background-color: #1e1e1e;
    border-left-color: #4fc3f7;
}

.dark-theme .stats-visualization-container {
    background-color: #2d2d2d;
}

.dark-theme .notification {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background-color: #2980b9;
}

.dark-theme .theme-toggle {
    background-color: #f39c12;
}

.dark-theme .theme-toggle:hover {
    background-color: #e67e22;
}

/* Discord button and credits styles */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.discord-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #5865F2;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.discord-button:hover {
    background-color: #4752c4;
}

.discord-button svg {
    width: 20px;
    height: 16px;
}

.credits {
    text-align: center;
    font-size: 14px;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.credits a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.credits a:hover {
    color: white;
    text-decoration: underline;
}

.dark-theme .discord-button {
    background-color: #5865F2;
}

.dark-theme .discord-button:hover {
    background-color: #4752c4;
}

.header-actions {
    display: flex;
    align-items: center;
}

@media (max-width: 600px) {
    .header-content {
    flex-direction: column;
    gap: 15px;
    }
    
    .header-actions {
    margin-bottom: 10px;
    }
}

.github-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #24292e;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    margin-left: 10px;
    transition: background-color 0.2s ease;
}

.github-button:hover {
    background-color: #1b1f23;
}

.github-button svg {
    width: 20px;
    height: 20px;
}

.dark-theme .github-button {
    background-color: #333;
}

.dark-theme .github-button:hover {
    background-color: #444;
}

.raw-data-display {
  width: 100%;
  max-height: 400px;
  overflow: auto;
  background-color: #f5f5f5;
  padding: 10px;
  font-family: monospace;
  font-size: 14px;
  white-space: pre;
  border-radius: 4px;
  margin-top: 10px;
}

.dark-theme .raw-data-display {
  background-color: #2a2a2a;
  color: #e0e0e0;
}

.raw-data-info {
  margin-bottom: 10px;
}

.supported-formats {
  font-size: 14px;
  color: #666;
  margin-top: 8px;
  margin-bottom: 10px;
}

.download-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #2ecc71;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  margin-right: 10px;
  transition: background-color 0.2s ease;
}

.download-button:hover {
  background-color: #27ae60;
}

.credits {
  text-align: center;
  font-size: 14px;
  margin-top: 5px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.dark-theme .supported-formats {
  color: #aaa;
}

.dark-theme .download-button {
  background-color: #2ecc71;
}

.dark-theme .download-button:hover {
  background-color: #27ae60;
}

.small-download-button {
  display: inline-block;
  padding: 6px 12px;
  background-color: #2ecc71;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 10px;
  transition: background-color 0.2s ease;
}

.small-download-button:hover {
  background-color: #27ae60;
}

.credits-small {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  margin-bottom: 8px;
}

.dark-theme .credits-small {
  color: #aaa;
}

.remove-dataset-btn {
  background-color: #ff5555;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 4px;
  
  /* Add these properties to center the X */
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  font-size: 16px;
}

.remove-dataset-btn:hover {
  background-color: #ff0000;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding: 10px 0;
}

.pagination-controls button {
  padding: 5px 10px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.pagination-controls button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.dark-theme .pagination-controls button {
  background-color: #4fc3f7;
}

.dark-theme .pagination-controls button:disabled {
  background-color: #444;
}

/* Bootstrap Confidence Interval Visualization Styles - Improved version */
.bootstrap-visualization {
  margin: 20px 0;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 4px;
  font-size: 14px;
}

.ci-container {
  margin-top: 15px;
}

.ci-row {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-start;
}

.ci-label {
  width: 180px;
  font-weight: 500;
  text-align: right;
  padding-right: 15px;
  flex-shrink: 0;
}

.ci-bars {
  flex: 1;
  min-width: 0; /* Important for proper flexbox behavior */
}

.ci-bar-container {
  margin-bottom: 15px;
}

.ci-label-small {
  font-size: 0.9em;
  margin-bottom: 3px;
  font-weight: 500;
}

.ci-bar {
  position: relative;
  padding-top: 20px; /* Space for labels above the bar */
  padding-bottom: 5px;
}

.ci-bar-inner {
  position: relative;
  height: 6px;
  background-color: #f0f0f0;
  border-radius: 3px;
  width: 100%;
}

.ci-range-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background-color: rgba(75, 192, 192, 0.2);
  border-radius: 3px;
}

.ci-mean-marker {
  position: absolute;
  top: -7px;
  width: 4px;
  height: 20px;
  background-color: rgba(75, 192, 192, 1);
  transform: translateX(-2px);
}

.ci-range-labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.85em;
  color: #666;
}

.ci-lower-label {
  text-align: left;
}

.ci-mean-label {
  text-align: center;
  font-weight: 500;
}

.ci-upper-label {
  text-align: right;
}

.bootstrap-interpretation {
  margin: 20px 0;
  padding: 10px 15px;
  background-color: #f0f8ff;
  border-radius: 4px;
  border-left: 4px solid #4bc0c0;
}

/* Mobile optimization */
@media (max-width: 768px) {
  .ci-row {
    flex-direction: column;
  }
  
  .ci-label {
    width: 100%;
    text-align: left;
    padding-right: 0;
    margin-bottom: 10px;
  }
}

/* Frame Stability Visualization Styles - Improved version */
.frame-stability-visualization {
  margin: 20px 0;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 4px;
}

.stability-container {
  margin-top: 15px;
}

.stability-controls {
  display: flex;
  margin-bottom: 15px;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.stability-btn {
  padding: 6px 12px;
  background-color: #f1f1f1;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.stability-btn:hover {
  background-color: #e8e8e8;
}

.stability-btn.active {
  background-color: #4bc0c0;
  color: white;
  border-color: #4bc0c0;
}

.stability-view-container {
  width: 100%;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  overflow-x: auto; /* Allow horizontal scrolling if needed */
}

.stability-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 15px;
  border-top: 1px solid #eee;
  padding-top: 15px;
  flex-wrap: wrap;
}

.stability-stat-column {
  flex: 1;
  min-width: 250px;
  padding: 0 15px;
  margin-bottom: 15px;
}

.stability-stat-column h5 {
  margin-top: 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

.stability-stat-column ul {
  padding-left: 20px;
  margin-top: 5px;
}

.stability-stat-column li {
  margin-bottom: 5px;
  font-size: 0.9em;
  line-height: 1.4;
}

/* Enhanced styles for the statistics table with multiple datasets */
.stats-table-dataset-header {
    text-align: center;
    border-bottom: none;
    background-color: #6796c5;
    color: white;
}

.empty-stats-message {
    text-align: center;
    color: #888;
    font-size: 16px;
    padding: 30px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin: 20px 0;
    display: none;
}

.empty-stats table {
    display: none;
}

.empty-stats .empty-stats-message {
    display: block;
}

.dark-theme .empty-stats-message {
    color: #aaa;
    background-color: #2a2a2a;
    border-color: #444;
}

/* Updated statistics table styles */
#statsTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#statsTable th {
    background-color: #6796c5;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
}

#statsTable td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

#statsTable .dataset-name-cell {
    text-align: left;
    font-weight: bold;
    background-color: #f8f9fa;
    border-right: 1px solid #e0e0e0;
}

#statsTable .stats-metric-header th {
    background-color: #4a7db9;
    text-align: center;
    font-size: 16px;
    padding: 12px;
}

#statsTable .metric-spacer-row {
    height: 20px;
    background-color: #f5f7fa;
}

.dark-theme #statsTable .metric-spacer-row {
    background-color: #222;
}

.dark-theme #statsTable th {
    background-color: #1e466e;
}

.dark-theme #statsTable .stats-metric-header th {
    background-color: #0d325c;
}

.dark-theme #statsTable td {
    border-color: #444;
}

.dark-theme #statsTable .dataset-name-cell {
    background-color: #333;
}

.dataset-better-value {
    font-weight: bold;
    color: #2ecc71;
}

.dataset-worse-value {
    color: #e74c3c;
}

.dark-theme .dataset-better-value {
    color: #2ecc71;
}

.dark-theme .dataset-worse-value {
    color: #e74c3c;
}

/* Add alternating row coloring */
#statsTable tbody tr:nth-child(even):not(.stats-metric-header):not(.metric-spacer-row) {
    background-color: #f2f2f2;
}

.dark-theme #statsTable tbody tr:nth-child(even):not(.stats-metric-header):not(.metric-spacer-row) {
    background-color: #2a2a2a;
}

/* Make the table scrollable if it gets too wide */
#statistics {
    overflow-x: auto;
}

/* lay the controls in a single row, allow wrapping if window is narrow */
#visualization .controls{
  display:flex;
  flex-wrap:wrap;
  gap:1rem;
}

/* datasetGroup stacks its children vertically (label, select, button) */
#datasetGroup{
  display:flex;
  flex-direction:column;
}

/* Action buttons under Advanced Metrics */
#datasetGroup .chart-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

#datasetGroup .chart-actions button {
  flex: 1 1 auto;
  height: 34px;
  font-size: 13px;
  padding: 6px 10px;
}

/* Slight tightening if multiselect is tall */
#datasetGroup {
  min-width: 190px;
}

/* Inline rows for visualization controls */
.viz-inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-top: .25rem;
}
.viz-inline-row.secondary {
  margin-top: .35rem;
}

/* Make the groups a bit narrower & consistent */
.control-group.compact {
  min-width: 170px;
  flex: 1 1 170px;
}

.color-group {
  max-width: 260px;
}

.color-picker-container.slim {
  gap: 6px;
}

.color-picker-container.slim input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 0;
}

.secondary-button.mini {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.1;
}

/* Time-based X smaller label */
.time-toggle {
  display: flex;
  align-items: flex-end;
  flex: 0 1 160px;
  min-width: 140px;
}

.time-toggle .tiny-label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  margin: 0;
}

.time-toggle .tiny-label input {
  margin: 0;
  transform: translateY(1px);
}

.time-toggle .tiny-label .sub {
  font-weight: normal;
  font-size: 11px;
  color: #888;
  letter-spacing: .2px;
  margin-left: 2px;
}

/* Dark theme tweaks */
.dark-theme .time-toggle .tiny-label {
  color: #ccc;
}
.dark-theme .time-toggle .tiny-label .sub {
  color: #999;
}

/* Slight tightening of selects in compact groups */
.control-group.compact select {
  max-width: 210px;
}

/* Responsive: stack gracefully */
@media (max-width: 820px) {
  .viz-inline-row {
    flex-direction: row;
  }
  .time-toggle {
    flex: 1 1 140px;
  }
}

@media (max-width: 560px) {
  .viz-inline-row {
    flex-direction: column;
    align-items: stretch;
  }
  .control-group.compact,
  .time-toggle,
  .color-group {
    flex: 1 1 auto;
    max-width: none;
  }
  .color-picker-container.slim {
    flex-wrap: wrap;
  }
}
