.carte {
    height: 100%;
    width: 100%;
    border-radius: 8px;
}

.trace-row {
    height: 150px;
    margin-top: 10px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .trace-row {
        height: 50px;
    }
}

.trace-col {
    align-self: center !important;
}

.trace-col-entete {
    font-weight: bold;
}

/* .leaflet-tile-pane {
    filter: contrast(70%) brightness(105%) grayscale(50%);
} */

#modal_carte {
    height: 400px;
    width: 100%;
}

:root {
    --paper: #EDE6D6;
    --paper-deep: #E4DAC2;
    --card: #F5F0E4;
    --ink: #26312B;
    --ink-soft: #6B7268;
    --line: #CBBF9E;
    --forest: #2F5D50;
    --forest-deep: #1E3F35;
    --rust: #C1652F;
    --slate: #3E7C8C;
    --steep: #A63A2E;
    --easy: #5C8A63;
    --shadow: rgba(38, 49, 43, 0.14);
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
}

.denivele {
    background-color: var(--paper);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(203, 191, 158, 0.35) 0, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(203, 191, 158, 0.3) 0, transparent 50%);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
    padding: clamp(20px, 4vw, 56px) 20px 60px;
}

/* ---------- header ---------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    margin: 0 0 6px;
    color: var(--forest-deep);
    letter-spacing: -0.01em;
}

.meta {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.change-link {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--forest);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 6px 0;
    white-space: nowrap;
}

.change-link:hover {
    color: var(--forest-deep);
}

/* ---------- stats row ---------- */
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.stat {
    flex: 1 1 140px;
    padding: 18px 22px;
    border-left: 1px solid var(--line);
}

.stat:first-child {
    border-left: none;
}

.stat .num {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    line-height: 1.1;
    color: var(--forest-deep);
    font-variant-numeric: tabular-nums;
}

.stat .num small {
    font-size: 0.55em;
    font-weight: 500;
    color: var(--ink-soft);
    margin-left: 2px;
}

.stat .label {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-top: 4px;
}

/* ---------- controls ---------- */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.segmented {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: var(--card);
}

.segmented button {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 7px 16px;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
}

.segmented button.active {
    background: var(--forest);
    color: #fff;
}

.smooth-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.smooth-toggle label {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--line);
    position: relative;
    flex: none;
    transition: background 0.15s ease;
}

.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

input.smooth-checkbox {
    display: none;
}

input.smooth-checkbox:checked+.switch {
    background: var(--forest);
}

input.smooth-checkbox:checked+.switch::after {
    left: 18px;
}

/* ---------- chart card ---------- */
.chart-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px 20px 16px;
    box-shadow: 0 8px 24px -18px var(--shadow);
}

.chart-canvas-wrap {
    position: relative;
    height: 340px;
}

#eleChart {
    width: 100%;
    height: 100%;
}

.strip-wrap {
    margin-top: 6px;
    height: 22px;
    position: relative;
}

#gradeStrip {
    display: block;
    height: 22px;
}

.legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

footer {
    margin-top: 18px;
    color: var(--ink-soft);
    font-size: 0.82rem;
}

/* ---------- upload / empty / error state ---------- */
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: clamp(28px, 5vw, 48px);
    text-align: center;
}

.panel h1 {
    margin-bottom: 10px;
}

.panel p {
    color: var(--ink-soft);
    max-width: 44ch;
    margin: 0 auto 26px;
}

.dropzone {
    border: 2px dashed var(--line);
    border-radius: 10px;
    padding: 34px 20px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin-bottom: 18px;
}

.dropzone.drag {
    border-color: var(--forest);
    background: rgba(47, 93, 80, 0.06);
}

.dropzone svg {
    margin-bottom: 10px;
    color: var(--forest);
}

.dropzone .dz-text {
    font-weight: 600;
    color: var(--forest-deep);
}

.dropzone .dz-sub {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 4px;
}

.or-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-soft);
    font-size: 0.82rem;
    margin: 18px 0;
}

.or-row::before,
.or-row::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.path-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.path-form input[type=text] {
    font-family: var(--font-body);
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 260px;
    flex: 1;
    background: #fff;
}

.path-form button {
    font-family: var(--font-body);
    font-weight: 600;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: var(--forest);
    color: #fff;
    cursor: pointer;
}

.path-form button:hover {
    background: var(--forest-deep);
}

.error-box {
    background: #F6E9E4;
    border: 1px solid var(--steep);
    color: #6f2416;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 22px;
    text-align: left;
    font-size: 0.92rem;
}

.carte-modal {
    width: 100%;
    height: 400px;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.modal-body {
    padding: 20px;
    overflow-y: scroll;
    scrollbar-width: none;
}