.jdt-super-container {
    margin: auto;
    max-width: 1200px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    font-family: system-ui, sans-serif;
}

.jdt-super-container * {
    box-sizing: border-box;
}

.jdt-surtitle {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ea580c;
}

.jdt-intro {
    margin-bottom: 10px;
    color: #000;
}

.jdt-mega-title {
    margin: 0 0 10px;
    font-size: 3rem;
    line-height: 1.2;
    color: #111827;
}

.jdt-super-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 2rem;
    color: #1e293b;
}

/* ── My plans tab content ─────────────────────────────────────────── */

.jdt-tab-content-myplans {
    display: none;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.jdt-my-plans-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Plan card */
.jdt-plan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.jdt-plan-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.jdt-plan-card-info {
    flex: 1;
    min-width: 0;
}

.jdt-plan-card-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jdt-plan-card-meta {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Visibility badge */
.jdt-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.jdt-plan-badge-public {
    background: #dcfce7;
    color: #166534;
}

.jdt-plan-badge-private {
    background: #fef3c7;
    color: #92400e;
}

/* Action buttons row */
.jdt-plan-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.jdt-plan-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, filter 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.jdt-plan-action-btn:hover {
    filter: brightness(0.9);
}

.jdt-plan-action-view {
    background: #16a34a;
    color: #fff;
}

.jdt-plan-action-share {
    background: #2563eb;
    color: #fff;
}

.jdt-plan-action-delete {
    background: #dc2626;
    color: #fff;
}

/* Delete confirmation inline */
.jdt-plan-delete-confirm {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 1.2rem;
    color: #991b1b;
}

.jdt-plan-delete-confirm.active {
    display: flex;
}

.jdt-plan-confirm-yes {
    background: #dc2626;
    color: #fff;
}

.jdt-plan-confirm-no {
    background: #e2e8f0;
    color: #0f172a;
}

/* Login message */
.jdt-myplans-login-msg {
    display: none;
    text-align: center;
    padding: 30px 20px;
    color: #475569;
}

.jdt-myplans-login-msg p {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.jdt-myplans-login-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.jdt-myplans-login-btn {
    background: #3b82f6 !important;
    color: #fff !important;
    text-decoration: none;
    font-size: 1rem !important;
}

.jdt-myplans-signup-btn {
    background: #16a34a !important;
    color: #fff !important;
    text-decoration: none;
    font-size: 1rem !important;
}

/* Empty state */
.jdt-myplans-empty {
    text-align: center;
    padding: 20px;
}

@media (max-width: 700px) {
    .jdt-plan-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .jdt-plan-card-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

/* ── GPX tabs ─────────────────────────────────────────────────────── */

.jdt-gpx-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.jdt-gpx-tabs .jdt-gpx-btn {
    flex: 1;
}

.jdt-gpx-tab-inactive {
    background: #e2e8f0;
    color: #0f172a;
}

/* ── Public search tab ────────────────────────────────────────────── */

.jdt-tab-content-public {
    display: none;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.jdt-public-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.jdt-public-search-input {
    flex: 2;
}

.jdt-public-dist-select {
    flex: 1;
}

.jdt-public-loading {
    display: none;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 15px;
}

.jdt-public-plans-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.jdt-public-plans-hint {
    color: #64748b;
    font-size: 0.9rem;
}

/* ── Diagnostic card ──────────────────────────────────────────────── */

.jdt-diagnostic-val {
    font-size: 1.2rem;
}

/* ── Ref pace helper text ─────────────────────────────────────────── */

.jdt-ref-pace-hint {
    font-size: 0.95rem;
    color: #64748b;
}

/* ── Save form ────────────────────────────────────────────────────── */

.jdt-save-form {
    margin-top: 20px;
    padding: 10px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.jdt-save-msg {
    font-weight: bold;
}

/* ── Generate button ──────────────────────────────────────────────── */

.jdt-generate-btn {
    width: 100%;
}

/* ── Segments preview ─────────────────────────────────────────────── */

.jdt-segments-preview {
    display: none;
}

.jdt-gpx-upload-area {
    display: block;
    margin-bottom: 20px;
    padding: 30px;
    text-align: center;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jdt-gpx-upload-area:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.jdt-gpx-upload-area input[type="file"] {
    display: none;
}

.jdt-gpx-btn {
    display: inline-block;
    width: auto;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: #3b82f6;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.jdt-gpx-btn:hover {
    background: #2563eb;
}

.jdt-gpx-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.jdt-print-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #10b981;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.jdt-print-btn:hover {
    background: #059669;
}

.jdt-print-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.jdt-gpx-results {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.jdt-gpx-card {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f1f5f9;
    text-align: center;
}

.jdt-gpx-card-reference {
    background: #fff7ed;
}

.jdt-gpx-val {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
}

.jdt-gpx-label {

    color: #64748b;
    text-transform: uppercase;
}

/* ── Loaded plan banner ───────────────────────────────────────────── */

.jdt-loaded-plan-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    margin-top: 5px;
    padding: 14px 18px;
    /*border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);*/
}

.jdt-loaded-plan-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.jdt-loaded-plan-title {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jdt-loaded-plan-date {
    color: #6366f1;
    font-weight: 500;
}

.jdt-copy-link-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #a5b4fc;
    border-radius: 8px;
    background: #ffffff;
    color: #4f46e5;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.jdt-copy-link-btn:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.jdt-chart-wrapper {
    display: none;
    width: 100%;
    height: 250px;
    margin-bottom: 30px;
}

.jdt-loading {
    display: none;
    margin: 10px 0;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    font-weight: 500;
}

.jdt-error {
    display: none;
    margin: 12px 0 20px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 1.5rem;
    font-weight: 700;
}

.jdt-step2 {
    display: none;
    padding-top: 24px;
    border-top: 2px solid #f1f5f9;
}

.jdt-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.jdt-save-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr auto;
    gap: 15px;
    align-items: stretch;
    margin-bottom: 15px;
}

.jdt-save-btn-cell {
    display: flex;
    align-items: flex-end;
}

.jdt-save-btn-cell .jdt-gpx-btn {
    width: 100%;
    white-space: nowrap;
}

@media (max-width: 800px) {
    .jdt-save-grid {
        grid-template-columns: 1fr;
    }
}

.jdt-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #334155;
    font-weight: 500;
}

.jdt-input,
.jdt-select {
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    font-size: 1.3rem;
}

.jdt-input:focus,
.jdt-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.jdt-time-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jdt-time-inputs input {
    width: 80px;
}

.jdt-step3 {
    display: none;
    margin-top: 30px;
    padding: 24px;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

.jdt-step3 h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    color: #1e293b;
    font-size: 1.3rem;
}

.jdt-step3 table,
.jdt-sections-preview table {
    width: 100%;
    margin-top: 15px;
    margin-bottom: 25px;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.jdt-step3 th,
.jdt-sections-preview th {
    padding: 12px;
    border-bottom: 2px solid #cbd5e1;
    background-color: #e2e8f0;
    color: #0f172a;
    text-align: left;
    font-weight: 600;
}

.jdt-step3 td,
.jdt-sections-preview td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: top;
}

.jdt-step3 ul {
    margin-bottom: 20px;
    padding-left: 0;
    list-style: none;
}

.jdt-step3 li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.jdt-sections-preview {
    display: none;
    margin-bottom: 20px;
}

.jdt-helper-text {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.jdt-full-width {
    grid-column: 1 / -1;
}

.jdt-segments-preview {
    display: none;
    margin-top: 24px;
    margin-bottom: 20px;
}

/* ── Timeline segments ─────────────────────────────────────────────── */

.jdt-timeline {
    display: flex;
    flex-direction: column;
    margin: 8px 0;
}

.jdt-tl-item {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.jdt-tl-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 18px;
}

.jdt-tl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    z-index: 1;
}

.jdt-tl-dot--start {
    background: #3b82f6;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #3b82f6;
}

.jdt-tl-dot--ravito {
    background: #10b981;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #10b981;
    margin-top: auto;
}

.jdt-tl-dot--end {
    background: #f59e0b;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #f59e0b;
    margin-top: auto;
}

.jdt-tl-line {
    width: 2px;
    flex: 1;
    background: #e2e8f0;
    margin: 4px 0;
}

.jdt-tl-right {
    flex: 1;
    padding-bottom: 24px;
    min-width: 0;
}

.jdt-tl-point-label {
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 6px;
    padding: 2px 8px;
    background: #eff6ff;
    border-radius: 4px;
    display: inline-block;
}

.jdt-tl-point-label--end {
    color: #f59e0b;
    background: #fffbeb;
    margin-top: 6px;
    margin-bottom: 0;
}

.jdt-tl-segment-body {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jdt-tl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.jdt-tl-meta span {
    color: #475569;
    background: #e2e8f0;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.jdt-tl-type {
    color: #1e293b !important;
    background: #dbeafe !important;
    font-weight: 600;
}

.jdt-tl-time {
    color: #1e293b !important;
    background: #dcfce7 !important;
    font-weight: 700 !important;
}

.jdt-tl-needs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.jdt-tl-needs span {
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
}

.jdt-tl-slope-moy {
    color: #997200 !important;
    font-weight: 600;
    padding: 0px !important;
}

.jdt-tl-slope-max {
    color: #991b1b !important;
    font-weight: 700;
    padding: 0px !important;
}

/* ── Plan header ───────────────────────────────────────────────────── */

.jdt-plan-header {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.jdt-plan-pacing {
    color: #0f172a;
}

.jdt-plan-diag {
    font-weight: 700;
    text-transform: capitalize;
}

.jdt-plan-diag-detail {
    color: #475569;
}

.jdt-plan-advice {
    color: #334155;
    font-style: italic;
    border-top: 1px dashed #e2e8f0;
    padding-top: 6px;
    margin-top: 2px;
}

/* ── Boutons bas du plan ───────────────────────────────────────────── */

.jdt-step3-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.jdt-regen-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #6366f1;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.jdt-regen-btn:hover {
    background: #4f46e5;
}

.jdt-reset-btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.jdt-reset-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* ── Ravito chips ──────────────────────────────────────────────────── */

.jdt-ravitos-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    align-items: center;
}

.jdt-ravito-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
    font-size: 1.3rem;
    font-weight: 500;
}

.jdt-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #bbf7d0;
    color: #166534;

    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.jdt-chip-remove:hover {
    background: #4ade80;
    color: #14532d;
}

/* ── Bouton "Ajouter un ravito" dans le tableau ────────────────────── */

.jdt-add-ravito-cell {
    white-space: nowrap;
    text-align: right;
}

.jdt-add-ravito-btn {
    padding: 3px 8px;
    border: 1px dashed #86efac;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
    align-self: flex-start;
}

.jdt-add-ravito-btn:hover {
    background: #3dbf65;
    border-color: #4ade80;
}

/* ── Formulaire inline dans la cellule ────────────────────────────── */

.jdt-inline-add-form {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.jdt-inline-km-input {
    width: 80px !important;
    padding: 5px 8px !important;

}

.jdt-inline-km-unit {

    color: #64748b;
}

.jdt-confirm-ravito-btn,
.jdt-cancel-ravito-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.jdt-confirm-ravito-btn {
    background: #10b981;
    color: #ffffff;
}

.jdt-confirm-ravito-btn:hover {
    background: #059669;
}

.jdt-cancel-ravito-btn {
    background: #e2e8f0;
    color: #475569;
}

.jdt-cancel-ravito-btn:hover {
    background: #cbd5e1;
}

@media (max-width: 640px) {
    .jdt-super-container {
        padding: 16px;
    }

    .jdt-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .jdt-time-inputs {
        flex-wrap: wrap;
    }

    .jdt-time-inputs input {
        width: 72px;
    }

    .jdt-step3-actions {
        flex-direction: column;
    }

    .jdt-step3 table,
    .jdt-sections-preview table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .jdt-gpx-val {
        font-size: 1.5rem;
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    .jdt-super-container,
    .jdt-super-container * {
        visibility: visible;
    }

    .jdt-super-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        width: 100%;
    }

    .jdt-gpx-upload-area,
    .jdt-gpx-tabs,
    .jdt-tab-content-myplans,
    .jdt-tab-content-public,
    .jdt-step2,
    .jdt-print-btn,
    .jdt-super-title:first-of-type,
    .jdt-error,
    .jdt-copy-link-btn,
    .jdt-save-form {
        display: none !important;
    }

    .jdt-step3 {
        margin-top: 0;
        padding: 0;
        border: none;
        background: transparent;
    }

    .jdt-chart-wrapper {
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
}