/* Reset pour la compatibilité */
.monte-carlo-widget * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables CSS */
:root {
    --color-blue: #6B7FFF;
    --color-green: #4CAF50;
    --color-orange: #FF9800;
    --color-purple: #9C27B0;
    --color-blue-light: rgba(107, 127, 255, 0.08);
    --color-green-light: rgba(76, 175, 80, 0.08);
    --color-orange-light: rgba(255, 152, 0, 0.08);
    --color-purple-light: rgba(156, 39, 176, 0.08);
    --color-blue-lighter: rgba(107, 127, 255, 0.04);
    --color-green-lighter: rgba(76, 175, 80, 0.04);
    --color-orange-lighter: rgba(255, 152, 0, 0.04);
    --color-purple-lighter: rgba(156, 39, 176, 0.04);
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --text-dark: #2C3E50;
    --text-medium: #5D6D7E;
    --text-light: #95A5A6;
    --border-color: #DFE6E9;
    --border-focus: #4A90E2;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.monte-carlo-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    border-radius: 8px;
    max-width: 900px;
    margin: 0 auto;
}

/* Sections */
.widget-section {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

.widget-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
}

.add-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: var(--bg-white);
    border: 1.5px solid var(--border-color);
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:hover:not(:disabled) {
    border-color: var(--border-focus);
    color: var(--border-focus);
    background: #F7FAFC;
}

.add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Liste des mesures */
.measurements-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.measurement-card {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 12px;
    position: relative;
    transition: all 0.2s;
}

.measurement-card:hover {
    box-shadow: var(--shadow-sm);
}

.measurement-card.color-blue { background: var(--color-blue-light); }
.measurement-card.color-green { background: var(--color-green-light); }
.measurement-card.color-orange { background: var(--color-orange-light); }
.measurement-card.color-purple { background: var(--color-purple-light); }

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
}

.remove-btn:hover {
    background: #FFF5F5;
    border-color: #FC8181;
    color: #E53E3E;
}

/* Nouvelle structure des champs de mesure */
.field-labels {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 3px;
    font-size: 10px;
    color: var(--text-medium);
    font-weight: 500;
}

.field-labels .label-symbol {
    flex: 0 0 44px;
    text-align: center;
}

.field-labels .label-equals-spacer {
    width: 9px;
}

.field-labels .label-paren-spacer {
    width: 7px;
}

.field-labels .label-pm-spacer {
    width: 9px;
}

.field-labels .label-value {
    flex: 0 0 60px;
    text-align: center;
}

.field-labels .label-uncertainty {
    flex: 0 0 60px;
    text-align: center;
}

.measurement-fields {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.field-symbol {
    flex: 0 0 38px;
}

.field-equals {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 500;
}

.field-paren-open {
    font-size: 17px;
    color: var(--text-dark);
}

.field-value {
    flex: 0 0 60px;
}

.field-pm {
    font-size: 15px;
    color: var(--text-dark);
}

.field-uncertainty {
    flex: 0 0 60px;
}

.field-paren-close {
    font-size: 17px;
    color: var(--text-dark);
}

.field-exponent {
    flex: 1;
    min-width: 0;
}

.monte-carlo-widget input[type="text"],
.monte-carlo-widget input[type="number"],
.monte-carlo-widget select {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 7px 8px;
    font-size: 13px;
    color: var(--text-dark);
    background: var(--bg-white);
    font-family: inherit;
    transition: all 0.2s;
    width: 100%;
}

.monte-carlo-widget input:focus,
.monte-carlo-widget select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.symbol-input {
    text-align: center;
    font-size: 18px !important;
    font-style: italic;
    font-weight: 600;
}

/* Couleurs pour les inputs */
.monte-carlo-widget .color-blue input,
.monte-carlo-widget .color-blue select {
    color: var(--color-blue) !important;
    font-weight: 600;
    background: var(--color-blue-lighter) !important;
}

.monte-carlo-widget .color-green input,
.monte-carlo-widget .color-green select {
    color: var(--color-green) !important;
    font-weight: 600;
    background: var(--color-green-lighter) !important;
}

.monte-carlo-widget .color-orange input,
.monte-carlo-widget .color-orange select {
    color: var(--color-orange) !important;
    font-weight: 600;
    background: var(--color-orange-lighter) !important;
}

.monte-carlo-widget .color-purple input,
.monte-carlo-widget .color-purple select {
    color: var(--color-purple) !important;
    font-weight: 600;
    background: var(--color-purple-lighter) !important;
}

/* Visualisation */
.distribution-viz {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.distribution-row {
    position: absolute;
    top: 16px;
    left: 8px;
    z-index: 5;
}

.distribution-row select {
    font-size: 11px;
    padding: 5px 8px;
    width: auto;
    min-width: 120px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
}

.distribution-chart {
    width: 100%;
    height: 90px;
    margin-bottom: 0;
}

.distribution-labels {
    display: flex;
    font-size: 10px;
    color: var(--text-light);
    position: relative;
    margin-bottom: 8px;
}

.distribution-labels .label-left {
    position: absolute;
    transform: translateX(-50%);
}

.distribution-labels .label-center {
    position: absolute;
    transform: translateX(-50%);
}

.distribution-labels .label-right {
    position: absolute;
    transform: translateX(-50%);
}

.distribution-labels .label-exponent {
    position: absolute;
    right: 0;
}

/* Section calculée */
.calculated-section {
    background: var(--bg-light);
}

.calculated-form {
    max-width: 600px;
}

.formula-input-group {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.formula-symbol {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.formula-symbol label {
    font-size: 10px;
    color: var(--text-light);
    font-weight: 500;
}

#calc-symbol {
    width: 60px;
    text-align: center;
    font-size: 18px;
    font-style: italic;
}

.formula-equals {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.formula-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.formula-input-wrapper label {
    font-size: 10px;
    color: var(--text-light);
    font-weight: 500;
}

#calc-formula {
    font-family: 'Courier New', Consolas, monospace !important;
    font-size: 13px !important;
}

.formula-preview {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 16px;
}

.preview-label {
    display: none;
}

.formula-display {
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

/* Action buttons container */
.action-buttons {
    width: 100%;
    max-width: 400px;
    display: flex;
    gap: 8px;
}

.calculate-btn, .sensitivity-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 18px;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
}

.calculate-btn,
.sensitivity-btn {
    background: var(--color-blue);
}

.calculate-btn:hover,
.sensitivity-btn:hover {
    background: #3A7BC8;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.calculate-btn:active,
.sensitivity-btn:active {
    transform: translateY(0);
}

.calculate-btn:disabled,
.sensitivity-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--color-blue);
}

/* Classes pour colorer les variables dans KaTeX */
.var-blue {
    color: var(--color-blue) !important;
}

.var-green {
    color: var(--color-green) !important;
}

.var-orange {
    color: var(--color-orange) !important;
}

.var-purple {
    color: var(--color-purple) !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.close-modal-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Contrôles de simulation */
.controls-wrapper {
    position: relative;
    min-height: 48px;
    margin-bottom: 16px;
}

.controls-header {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 14px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFC 100%);
    border: 1px solid #CBD5E0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.control-btn svg {
    flex-shrink: 0;
}

.control-btn span {
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.control-btn:active {
    transform: scale(0.98);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn.primary {
    background: #18AECB;
    color: white;
    border-color: #2C5282;
}

.control-btn.primary svg {
    filter: brightness(0) invert(1);
}

.control-btn.primary:active {
    background: linear-gradient(180deg, #3182CE 0%, #2C5282 100%);
}

.batch-control {
    display: flex;
    gap: 0;
    align-items: center;
    flex: 2;
}

.batch-control .control-btn {
    border-radius: 8px 0 0 8px;
    flex: 1;
}

#num-draws {
    width: 70px !important;
    height: 24px !important;
    padding: 8px;
    border: 1px solid #CBD5E0;
    border-radius: 0 8px 8px 0;
    border-left: none;
    font-size: 14px;
    font-family: inherit;
    background: white;
    line-height: 1;
    flex-shrink: 0;
}

/* Barre de progression */
.progress-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #EDF2F7;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4299E1 0%, #3182CE 100%);
    width: 0%;
    transition: width 0.1s linear;
}

.progress-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-medium);
}

/* Section des tirages */
.draws-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.draws-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-medium);
}

#draws-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 0;
}

.draw-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
}

.draw-item.color-blue { background: var(--color-blue-light); }
.draw-item.color-green { background: var(--color-green-light); }
.draw-item.color-orange { background: var(--color-orange-light); }
.draw-item.color-purple { background: var(--color-purple-light); }

.draw-symbol {
    font-size: 16px;
    font-weight: 600;
    font-style: italic;
    min-width: 30px;
}

.draw-item.color-blue .draw-symbol { color: var(--color-blue); }
.draw-item.color-green .draw-symbol { color: var(--color-green); }
.draw-item.color-orange .draw-symbol { color: var(--color-orange); }
.draw-item.color-purple .draw-symbol { color: var(--color-purple); }

.draw-equals {
    font-size: 14px;
    font-weight: 500;
}

.draw-value {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.draw-item.color-blue .draw-value { color: var(--color-blue); }
.draw-item.color-green .draw-value { color: var(--color-green); }
.draw-item.color-orange .draw-value { color: var(--color-orange); }
.draw-item.color-purple .draw-value { color: var(--color-purple); }

/* Flèche */
.arrow-down-container {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

.arrow-down {
    display: block;
}

/* Résultat */
.result-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
}

.equals-separator {
    font-size: 18px;
    font-weight: 600;
}

.calculated-value {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--text-dark);
}

/* Histogramme et stats */
.histogram-stats-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.histogram-section,
.stats-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

#histogram-canvas {
    width: 100%;
    height: 300px;
    display: block;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.stat-label {
    font-weight: 600;
    color: var(--text-medium);
}

.stat-value {
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    color: #5A5A5A;
}

.final-result {
    margin-top: 12px;
    padding: 14px;
    background: #F5F5F5;
    border: 2px solid #8B8B8B;
    border-radius: 8px;
    text-align: center;
}

.final-result span {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #3A3A3A;
}

.result-hint {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-medium);
    text-align: center;
}

.btn-afficher-resultat {
    width: 100%;
    background: linear-gradient(180deg, #48BB78 0%, #38A169 100%);
    color: white;
    border: 1px solid #2F855A;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-afficher-resultat:active {
    background: linear-gradient(180deg, #38A169 0%, #2F855A 100%);
    transform: scale(0.98);
}

.btn-afficher-resultat:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.final-result-formatted {
    margin-top: 10px;
    padding: 14px;
    background: #F0FFF4;
    border: 2px solid #48BB78;
    border-radius: 8px;
    text-align: center;
}

.final-result-formatted-label {
    font-size: 13px;
    font-weight: 600;
    color: #38A169;
    margin-bottom: 6px;
}

.final-result-formatted-value {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #2F855A;
}

/* Styles de la modale de sensibilité */
.sensitivity-modal-content {
    max-width: 900px;
}

.sensitivity-container {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.sensitivity-header {
    margin-bottom: 20px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.sensitivity-title {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    line-height: 1.4;
}

.sensitivity-title .katex {
    font-weight: bold;
}

.help-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(180deg, #FFFFFF 0%, #E5E5E5 100%);
    border: 1px solid #B8B8B8;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.1s;
    cursor: pointer;
}

.help-btn:active {
    background: linear-gradient(180deg, #D0D0D0 0%, #E0E0E0 100%);
    transform: scale(0.95);
}

@media (hover: hover) {
    .help-btn:hover {
        background: linear-gradient(180deg, #F8F8F8 0%, #D8D8D8 100%);
        border-color: #A0A0A0;
    }
}

.sensitivity-info {
    color: var(--text-medium);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

.chart-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: 0;
    padding: 20px 0;
}

@media (min-width: 768px) {
    .chart-section {
        flex-direction: row;
        gap: 32px;
    }
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

@media (min-width: 768px) {
    .chart-legend {
        width: 220px;
        flex-shrink: 0;
    }
}

.pie-chart {
    width: 100%;
    max-width: 350px;
    height: auto;
    flex-shrink: 0;
    touch-action: none;
}

@media (min-width: 768px) {
    .pie-chart {
        width: 350px;
        height: 350px;
    }
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background-color: #FAF9F8;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.15s;
    min-height: 48px;
}

.legend-item:active {
    background-color: #F3F2F1;
    transform: scale(0.98);
}

@media (hover: hover) {
    .legend-item:hover {
        background-color: #F3F2F1;
        box-shadow: var(--shadow);
    }
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--text-dark);
    flex: 1;
}

.legend-symbol {
    font-family: 'KaTeX_Math', 'Times New Roman', serif;
    font-style: italic;
    font-size: 18px;
    font-weight: 600;
}

.legend-value {
    font-weight: 600;
    font-size: 16px;
    margin-left: auto;
}

/* Modal d'aide de sensibilité */
.help-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.help-modal-content {
    background-color: #FFFFFF;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: #FFFFFF;
    z-index: 10;
}

.help-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
    padding-right: 12px;
}

.help-close-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(180deg, #FFFFFF 0%, #E5E5E5 100%);
    border: 1px solid #B8B8B8;
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    cursor: pointer;
}

.help-close-btn:active {
    background: linear-gradient(180deg, #D0D0D0 0%, #E0E0E0 100%);
    transform: scale(0.95);
}

@media (hover: hover) {
    .help-close-btn:hover {
        background: linear-gradient(180deg, #F8F8F8 0%, #D8D8D8 100%);
        border-color: #A0A0A0;
    }
}

.help-modal-body {
    padding: 20px;
}

.help-modal-body p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    color: var(--text-dark);
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.help-modal-body p:last-child {
    margin-bottom: 0;
}

.formula-block {
    margin: 20px 0;
    padding: 16px;
    background-color: #F9F9F9;
    border-radius: 8px;
    text-align: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsive */
@media (max-width: 768px) {
    .measurements-list {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .widget-section {
        /* padding: 14px; */
    }

    .field-value,
    .field-uncertainty {
        flex: 0 0 55px;
    }

    .field-labels .label-value,
    .field-labels .label-uncertainty {
        flex: 0 0 55px;
    }

    .histogram-stats-container {
        grid-template-columns: 1fr;
    }

    #draws-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        padding: 16px;
    }
}
