/* TM-inspired interface, not affiliated with the game */
:root{color-scheme:dark;font-family:system-ui,Arial,sans-serif;color:#f1f5ff;background:#0d1424}
body{background:#0d1424;color:#f1f5ff}header{background:#0d1424;padding:22px 3%;border-bottom:1px solid #33415d}header p{color:#aab9d2}
main{max-width:1600px;margin:18px auto}.card{background:#151f35;border:1px solid #273550;border-radius:5px;color:#f1f5ff;box-shadow:none;padding:18px}
h2{text-transform:uppercase;font-size:1.65rem;letter-spacing:.01em;border-bottom:1px solid #c4cbd9;padding-bottom:12px;margin-top:0}h3{font-size:1rem;margin-top:20px}
button,select,input,textarea{background:#202c43;color:#f1f5ff;border:1px solid #40506a}button{border-radius:18px;padding:9px 15px}button.primary,button.active,.active{background:#294e9b;color:white;border-color:#294e9b}
button:hover{filter:brightness(1.16)}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #7ea6ff;outline-offset:2px}
nav{gap:8px;margin:0 0 18px}nav button{font-size:13px;font-weight:650}
.muted,small,footer{color:#a4b3cb}table{border-collapse:collapse}td,th{border-bottom:1px solid #647085;color:#f0f5ff}th{background:#18233a;color:#dce8ff}tr:hover td{background:#1e2b45}input{background:#202c43;color:#fff}.notice{background:#253351;color:#e9f1ff}.notice.ok{background:#183e35}.metric{background:#1c2c46}
.tm-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}.tm-scroll{overflow-x:auto;max-width:100%}
.tm-table{border-collapse:collapse;width:100%;font-size:13px;white-space:nowrap}.tm-table th,.tm-table td{padding:10px 9px;text-align:center;border-bottom:1px solid #66738d}.tm-table th:first-child,.tm-table td:first-child,.tm-table th:nth-child(2),.tm-table td:nth-child(2){text-align:left}
.tm-table thead th{background:#121b30}.tm-table tbody tr:nth-child(even){background:#131d32}
.tm-circle{display:inline-flex;align-items:center;justify-content:center;width:29px;height:29px;border-radius:50%;color:#fff;font-weight:750;font-size:12px}
.tm-circle.empty{background:none;color:#71829d}.tm-ateliers{background:#aa3517;color:#fff;font-size:11px;padding:7px;border-radius:2px;display:block}.tm-line{font-weight:650;color:#dbe7ff}
.tm-tag{display:inline-block;padding:3px 8px;background:#294e9b;color:white;font-weight:650;font-size:11px}
.tm-negative{color:#ff657e;font-weight:bold}.tm-positive{color:#6ee6a4;font-weight:bold}
.tm-driver-grid th:first-child,.tm-driver-grid td:first-child{text-align:left}
.tm-driver-grid th:nth-child(2),.tm-driver-grid td:nth-child(2){text-align:center}
.tm-section-note{color:#a9b8d1;font-size:13px}
@media(max-width:700px){.card{padding:10px}header{padding:15px}h2{font-size:1.2rem}.tm-table{font-size:12px}}

.tm-sort{background:transparent;border:0;border-radius:3px;color:inherit;padding:4px 6px;font:inherit;font-weight:650;cursor:pointer;white-space:nowrap}
.tm-sort:hover{background:#2a3c5f}
.tm-sort-arrow{color:#9db9e9;font-size:11px;padding-left:4px}
.tm-sort:focus-visible{outline:2px solid #90bcff}

/* Explicit arrow controls in staff and vehicle headers */
.tm-driver-grid thead .tm-sort,.tm-table thead .tm-sort{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:30px}
.tm-driver-grid .tm-sort-arrow,.tm-table .tm-sort-arrow{display:inline-block;color:#e8f2ff;font-size:14px;font-weight:900;opacity:1}
.tm-driver-grid thead th[aria-sort="ascending"],.tm-driver-grid thead th[aria-sort="descending"]{background:#284879}

.tm-driver-grid .tm-proposed-row td{background:#1b2e49;font-weight:700}
.tm-driver-grid .tm-proposed-first td{border-top:3px solid #638cca}
.tm-delta{display:inline-block;margin-left:6px;font-size:.88em;font-weight:600}
.tm-delta-down{color:#78d6ac}.tm-delta-up{color:#f5b46a}.tm-delta-same{color:#aab9cf}

/* Prioritize the fleet number and service slots over descriptive columns. */
@media (max-width: 1400px){
 #tmvehicles .tm-vehicle-optional{display:none!important}
}
@media (max-width: 1200px){
 #tmvehicles .tm-vehicle-model{display:none!important}
 #tmvehicles .tm-table{font-size:12px}
 #tmvehicles .tm-table th,#tmvehicles .tm-table td{padding:8px 4px}
 #tmvehicles .tm-table .tm-sort{gap:3px;padding:3px 2px}
 #tmvehicles .tm-table .tm-sort-arrow{font-size:11px;padding-left:1px}
}
@media (max-width: 700px){
 #tmvehicles .tm-table th,#tmvehicles .tm-table td{padding:7px 3px}
}

/* Vertical boundaries between Semaine, Samedi and Dimanche in the vehicle grid. */
#tmvehicles .tm-table th.tm-period-start,
#tmvehicles .tm-table td.tm-period-start{
 border-left:3px solid #7896c4;
}

/* Documentation page */
.tm-help{max-width:1100px;margin-inline:auto;line-height:1.65}
.tm-help h3{font-size:1.12rem;margin-top:28px;padding-bottom:8px;border-bottom:1px solid #344764}
.tm-help ul,.tm-help ol{padding-left:24px}
.tm-help li{margin:9px 0}
.tm-help-lead{font-size:1.05rem;color:#dbe8f8}
.tm-help-priorities{display:grid;gap:10px;margin:16px 0}
.tm-help-priorities>div{display:flex;align-items:flex-start;gap:13px;border:1px solid #354866;background:#1a2a44;border-radius:10px;padding:12px 14px}
.tm-help-priorities>div>span{display:inline-grid;place-items:center;flex:0 0 33px;height:33px;border-radius:50%;font-weight:750;background:#3159a0;color:#fff}
.tm-help-priorities p{margin:3px 0}
.tm-help-formula{padding:14px;border-left:4px solid #78a9ff;background:#1b2d49;border-radius:6px;font-weight:650}

/* Changes page: same vehicle grid language, only changed buses. */
#changes .tm-change-grid{font-size:12px}
#changes .tm-change-grid th,#changes .tm-change-grid td{padding:8px 5px}
#changes .tm-change-grid .tm-period-start{border-left:3px solid #7896c4}
#changes .tm-change-grid td.tm-change-highlight{background:#254b40;box-shadow:inset 0 0 0 1px #5fba8a}
@media(max-width:1400px){#changes .tm-change-grid .tm-vehicle-optional{display:none!important}}
@media(max-width:1200px){#changes .tm-change-grid .tm-vehicle-model{display:none!important}#changes .tm-change-grid th,#changes .tm-change-grid td{padding:7px 3px}}

/* Fuel comparison: weekly period and individual-slot breakdown. */
.tm-fuel-period-details{margin:11px 0;border:1px solid #405374;border-radius:8px;overflow:hidden}
.tm-fuel-period-details summary{cursor:pointer;padding:12px 15px;background:#202e49;font-weight:650;color:#e7f0ff}
.tm-fuel-period-details[open] summary{border-bottom:1px solid #405374}
.tm-fuel-period-details .tablewrap{padding:5px 10px 10px}
.tm-fuel-period-details table{font-size:13px}
.tm-fuel-period-total th,.tm-fuel-period-total td{font-weight:750;background:#1b2f4c;border-top:2px solid #7896c4}

/* Average weekday (weekly total divided by five) beneath the period total. */
.tm-fuel-period-details .tm-fuel-daily-average td{font-size:11px;color:#aabbd3;background:#17263d;font-weight:400;border-bottom:1px solid #455775}
.tm-fuel-period-details .tm-fuel-daily-average td:first-child{font-weight:650;color:#cbd9ed}
.tm-fuel-period-details .tm-fuel-daily-average strong{font-size:11px}

/* Premium API prerequisite: readable warning on setup and documentation. */
.tm-premium-notice{margin:12px 0 20px;padding:15px 18px;border:1px solid #d6a34b;border-left:5px solid #f0bb59;border-radius:8px;background:#3a2e1f;color:#fff0d3;line-height:1.55}
.tm-premium-notice strong{color:#ffe3a5}
.tm-premium-notice>strong{display:block;font-size:1.08rem;margin-bottom:4px}
.tm-premium-notice p{margin:0}

/* Premiers pas: compact guided setup. */
.tm-onboarding .tm-onboarding-lead{font-size:1rem;line-height:1.6;max-width:950px}
.tm-onboarding-steps{display:grid;gap:13px;margin:20px 0}
.tm-onboarding-step{display:grid;grid-template-columns:38px minmax(0,1fr);gap:15px;padding:17px;border:1px solid #435675;border-radius:11px;background:#1c2940}
.tm-onboarding-step-num{width:36px;height:36px;display:grid;place-items:center;background:#2a5195;color:#fff;border-radius:50%;font-weight:800}
.tm-onboarding-step h3{margin:1px 0 8px;font-size:1.06rem}
.tm-onboarding-step p{line-height:1.6;margin:0 0 12px;color:#bfd0e6}
.tm-onboarding-step button,.tm-onboarding-tip button{width:auto;max-width:100%;white-space:normal}
.tm-onboarding-actions{display:flex;flex-wrap:wrap;gap:8px}
.tm-onboarding-tip{padding:16px 18px;border:1px solid #49658e;border-radius:11px;background:#1b304e;margin:18px 0}
.tm-onboarding-tip p{margin:7px 0 12px;line-height:1.5}
@media(max-width:520px){.tm-onboarding-step{grid-template-columns:30px minmax(0,1fr);padding:12px;gap:11px}.tm-onboarding-step-num{height:30px;width:30px}}

/* Deficit-only strategy and help explanation. */
#partialStrategySettings{border-left:4px solid #ecb65e}
#partialStrategySettings[hidden]{display:none!important}
#partialStrategySettings p{line-height:1.5}
.tm-help-deficit{margin:18px 0;padding:16px 18px;border:1px solid #b18b53;border-left:4px solid #edb45c;border-radius:9px;background:#302b29}
.tm-help-deficit>strong{display:block;margin-bottom:8px;font-size:1.06rem}
.tm-help-deficit p{line-height:1.55}

/* Calculation progress steps: theme-specific colors, no inline overrides. */
.tm-progress-step{padding:3px 0}
.tm-progress-done{color:#6ee6a4}
.tm-progress-current{color:#fff;font-weight:700}
.tm-progress-pending{color:#9caecb}

/* Changes grid filter — shared by light/dark themes. */
#changesVehicleFilterLabel[hidden]{display:none!important}
#changesVehicleFilter{max-width:270px}

/* Kilométrage par véhicule — sombre. */
.tm-mileage-grid th,.tm-mileage-grid td{padding:10px 12px}
.tm-mileage-grid th small{display:block;font-size:11px;font-weight:500;color:#9fb2ce;margin-top:3px}
.tm-mileage-grid .tm-mileage-value{text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}
.tm-mileage-grid thead th:nth-child(n+3):nth-child(-n+6){text-align:center}
.tm-mileage-grid .tm-mileage-weekly{font-weight:750}
.tm-mileage-grid .tm-mileage-total th{background:#243a5b;color:#e5efff;font-weight:750;border-top:2px solid #7b9bd0}
.tm-mileage-kind{display:block;margin-top:4px;font-size:10px;letter-spacing:.03em;color:#a4caff}
.tm-mileage-unavailable{display:block;font-size:10px;color:#ffab95;margin-top:4px}
.tm-mileage-detail summary{cursor:pointer;font-weight:650;color:#aacaf8;white-space:nowrap}
.tm-mileage-detail ul{margin:8px 0;padding-left:18px;min-width:240px;text-align:left;white-space:normal}
.tm-mileage-detail li{padding:3px 0}
@media(max-width:1000px){.tm-mileage-grid .tm-mileage-model{display:none!important}}

/* Forum import data-verification notice and consent (both themes). */
.tm-import-warning{margin:14px 0;padding:13px 16px;border:1px solid #d8a14b;border-left:4px solid #f3b84f;border-radius:8px;background:#332b21;color:#ffe8c1;line-height:1.5}
.tm-import-warning strong{display:block}
.tm-import-warning p{margin:7px 0 0}
.tm-import-verify{display:flex;align-items:flex-start;gap:9px;margin:13px 0;padding:11px 13px;border:1px solid #7294c1;border-radius:8px;line-height:1.5;cursor:pointer}
.tm-import-verify[hidden]{display:none!important}
.tm-import-verify input{margin-top:4px;flex-shrink:0}
.tm-import-number{text-align:center;font-variant-numeric:tabular-nums;white-space:nowrap}

/* Additional efficiency gains: compact breakdown in the Optimiseur results. */
.tm-efficiency-summary{border:1px solid #4c729c;border-left:4px solid #74c9a0;background:#1b3045;border-radius:9px;padding:12px 15px;margin:14px 0}
.tm-efficiency-summary>strong{display:block;font-size:1.03rem}
.tm-efficiency-summary p{margin:7px 0}
.tm-efficiency-summary .muted{font-size:.9em}
.tm-efficiency-summary summary{cursor:pointer;font-weight:650;padding:6px 0}
.tm-efficiency-summary .tablewrap{margin-top:8px}
.tm-efficiency-saving{white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:650}

.tm-efficiency-explain{font-size:.83em;line-height:1.5;color:#b6c8dc;white-space:nowrap;margin-top:3px;font-weight:400}

/* Experimental exact search report (dark theme). */
#tmExact .tm-exact-status{margin:14px 0;padding:12px 16px;border:1px solid #647c9d;border-left:4px solid #f4bc69;border-radius:9px;background:#263349}
#tmExact .tm-exact-status.tm-exact-proved{border-left-color:#76d8a2;background:#173a37}
#tmExact .tm-exact-status strong{display:block;margin-bottom:5px}
#tmExact .tm-exact-status p{margin:0;line-height:1.5}
#tmExact #tmExactResults .tablewrap{margin:12px 0}
#tmExact #tmExactResults table td,#tmExact #tmExactResults table th{padding:8px 11px}
#tmExact #tmExactProgress{margin:12px 0}

/* Charging switch — shared layout, dark palette. */
#lignesConfig .tm-charging-cell{min-width:210px;text-align:center;white-space:nowrap}
#lignesConfig .tm-charging-option{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:10px;cursor:pointer;font-weight:650;min-height:32px}
#lignesConfig .tm-charging-checkbox{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
#lignesConfig .tm-charging-track{display:inline-block;position:relative;width:40px;height:22px;flex:0 0 40px;border:1px solid #8ca3c1;border-radius:999px;background:#34445c;transition:background .15s,border-color .15s}
#lignesConfig .tm-charging-track::before{content:"";position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:50%;background:#e6edf6;transition:transform .15s}
#lignesConfig .tm-charging-checkbox:checked+.tm-charging-track{background:#2578d5;border-color:#73b0ff}
#lignesConfig .tm-charging-checkbox:checked+.tm-charging-track::before{transform:translateX(18px);background:#fff}
#lignesConfig .tm-charging-checkbox:focus-visible+.tm-charging-track{outline:3px solid #9bc9ff;outline-offset:3px}
#lignesConfig .tm-charging-state{min-width:28px;text-align:left;color:#edf4ff}
#lignesConfig .tm-charging-range{display:block;margin-top:3px;color:#b1c8e2;font-size:.78rem;line-height:1.35}
#lignesConfig .tm-charging-range strong{font-weight:650;color:#e2efff}
@media(prefers-reduced-motion:reduce){#lignesConfig .tm-charging-track,#lignesConfig .tm-charging-track::before{transition:none}}

/* Daily weekday average in the main energy-cost summary (dark theme). */
.tm-fuel-main-daily th,.tm-fuel-main-daily td{background:#23334d;color:#c7d6ec;font-size:.9em;border-bottom:1px solid #405575}
.tm-fuel-main-daily th{font-weight:550;padding-left:20px}
.tm-fuel-main-daily strong{font-weight:700}

/* One-day special shuttles: dark theme. */
#tmSpecial .tm-special-table{font-size:.92rem}
#tmSpecial .tm-special-table th{white-space:nowrap}
#tmSpecial .tm-special-table td{white-space:normal;min-width:88px}

/* Dynamic network: alphanumeric line identifiers — dark. */
#lignesConfig td:first-child .tm-circle{white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;font-weight:700}

/* Forum-only special lines: clearly informational, never an optimizer input. */
#tmSpecialNotice{margin-bottom:14px}
#tmSpecialNotice p{margin:8px 0 2px}
#tmSpecialNotice button{margin-left:8px}
#tmSpecial .tablewrap{margin:12px 0;overflow-x:auto}
#tmSpecial .tm-result-details{margin:12px 0}
#tmSpecial table th{white-space:nowrap}
