body {
    font-family: Arial, sans-serif;
    background: #f7f3e9;
    color: #333;
    margin: 10px;
}

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

nav a {
    margin-left: 10px;
    text-decoration: none;
    color: #333;
}

input, button, textarea {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    font-size: 16px;
    box-sizing: border-box;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; 
}

td, th {
    border: 1px solid #333;
    padding: 5px;
    text-align: center;
    overflow: hidden;
}

td input {
    width: 100%;
    margin: 0;
    padding: 4px;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

/* Daten-Tabelle: auf schmalen Bildschirmen horizontal scrollbar */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mindestbreite am Container statt an der Tabelle:
   Safari (iPhone) ignoriert min-width bei Tabellen */
.table-inner {
    min-width: 1000px;
}

.data-table th {
    font-size: 14px;
}

/* Datumsspalte bleibt beim Scrollen links stehen */
.data-table th:first-child,
.data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f7f3e9;
    width: 90px;
}

/* Notizspalte etwas breiter */
.data-table .col-note {
    width: 180px;
}

/* Diagramm-Seite: Zeitraum-Auswahl */
.range-controls,
.range-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.range-controls {
    flex-wrap: wrap;
}

.range-controls button,
.range-nav button {
    width: auto;
    white-space: nowrap;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.range-controls button.active {
    background: #333;
    color: #fff;
}

.range-nav button {
    font-size: 22px;
    padding: 2px 16px;
}

.range-nav button:disabled {
    opacity: 0.3;
    cursor: default;
}

#rangeLabel {
    min-width: 200px;
    text-align: center;
}

/* Diagramme untereinander, ohne Abstand, damit die senkrechten Linien durchgehen */
#charts {
    width: 100%;
}

/* Schieberegler mit zwei Griffen (Computer-Ansicht) */
.range-slider-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 14px;
    font-size: 12px;
    color: #666;
}

.range-slider {
    position: relative;
    flex: 1;
    height: 28px;
    touch-action: none;
    user-select: none;
}

.rs-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 12px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
}

.rs-band {
    position: absolute;
    top: 6px;
    height: 16px;
    background: rgba(51, 51, 51, 0.25);
    cursor: grab;
}

.rs-handle {
    position: absolute;
    top: 2px;
    width: 12px;
    height: 24px;
    margin-left: -6px;
    background: #333;
    border-radius: 3px;
    cursor: ew-resize;
    z-index: 1;
}

.chart-box {
    position: relative;
    width: 100%;
}

.chart-box canvas {
    display: block;
}

.chart-bool { height: 34px; }
.chart-num  { height: 150px; }
.chart-first { height: 58px; }  /* oberstes Diagramm mit Datumsachse (Höhe wird im Skript angepasst) */

/* Handy-Diagramm (diagram_mobile.php) */
.m-controls {
    gap: 4px;
}

.m-controls button {
    font-size: 14px;
    padding: 6px 8px;
}

.m-range {
    text-align: center;
    margin: 6px 0;
    font-weight: bold;
}

.m-info {
    min-height: 2.6em;
    font-size: 14px;
    text-align: center;
    margin: 4px 0 8px;
    color: #333;
}

.m-chart {
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.m-chart canvas {
    display: block;
}

.m-hint {
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* Diagramme durch abwechselnden Hintergrund trennen */
.chart-box:nth-child(even) {
    background: rgba(0, 0, 0, 0.05);
}

/* Gewicht als wichtigstes Diagramm hell hervorheben */
.chart-box.chart-highlight {
    background: #fff;
}