/* Fortschritt: Kennzahlen und Graph. Farben, Abstaende und Radien stammen aus den Variablen in base.css. */

/* ----------------------------------------------------------------
   Kennzahlen und Graph
---------------------------------------------------------------- */

.chartbox {
    height: 400px;
    padding: 20px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.stat .label {
    display: block;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
}

.stat .value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.stat .tag {
    align-self: flex-start;
}

.container.centered .stats,
.container.centered .stat {
    text-align: center;
}

.container.centered .stat .tag {
    align-self: center;
}

/* ----------------------------------------------------------------
   Auswahl der Werte (bis zu zwei nebeneinander, auf dem Handy untereinander)
---------------------------------------------------------------- */

/* Wert 1 und Wert 2 nebeneinander; auf dem Handy untereinander (responsive.css). */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 6px 0 18px;
}

/* RM-Umrechnung (drei Felder) und Zeitraum (zwei Felder) nebeneinander statt untereinander. */
#progress-form .rm-fields,
#progress-form .date-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 0 16px;
    align-items: start;
}

/* Die Checkbox der RPE-Option auf Hoehe der Eingabefelder daneben. */
#progress-form .rm-fields .checkrow {
    padding-top: 26px;
}

/* Gleich hoch, auch wenn nur eine Auswahl ein Uebungsfeld zeigt. */
fieldset.selection {
    min-width: 0;
    height: 100%;
    margin: 0;
}

/* In der breiten Box laeuft der Knopf nicht ueber die ganze Breite. */
#progress-form > .actions {
    justify-content: center;
}

#progress-form > .actions button {
    max-width: 360px;
}

fieldset.selection legend {
    padding: 0 4px;
}

.rm-fields {
    margin-bottom: 6px;
}

/* Kalorienrechner unter dem Graph */
#goal-field {
    margin: 0 0 24px;
    text-align: left;
    /* Sprungziel nach "Kalorien berechnen": nicht unter der festen Navigation verschwinden */
    scroll-margin-top: 90px;
}

#goal-field h3 {
    margin: 18px 0 12px;
    font-size: 15px;
}

.stat .hint {
    color: var(--muted);
    font-size: 12.5px;
}

/* Korrelation als Tacho: Striche von weiss (-1) nach gruen (+1), die Nadel zeigt den Wert */
.gauge {
    width: 100%;
    max-width: 240px;
    margin: 4px auto 0;
}

.gauge svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.gauge-ticks line {
    stroke-width: 2.5;
    stroke-linecap: square;
}

.gauge-ticks line.major {
    stroke-width: 3.5;
}

.gauge.is-undefined .gauge-ticks {
    opacity: 0.35;
}

.gauge-needle line {
    stroke: var(--text);
    stroke-width: 3;
    stroke-linecap: round;
}

.gauge-needle circle {
    fill: var(--text);
    stroke: var(--panel);
    stroke-width: 2;
}

.gauge figcaption {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    margin-top: 6px;
}

.gauge .value {
    line-height: 1.1;
}

.gauge-end {
    display: flex;
    flex-direction: column;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

.gauge-end small {
    color: var(--faint);
    font-size: 11.5px;
    font-weight: 500;
}

.gauge-end:last-child {
    align-items: flex-end;
    color: var(--accent-strong);
}

.stat.correlation .hint {
    text-align: center;
}

/* Personensuche: Lupe im Feld, Vorschlaege direkt darunter */
.person-search {
    position: relative;
}

.person-search input[type="search"] {
    padding-left: 38px;
}

.person-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.suggest-menu.person-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-width: none;
    text-align: left;
}

.person-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-suggestion .avatar.small {
    flex: none;
    width: 28px;
    height: 28px;
}
