@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');
:root{--ink:#172e3b;--muted:#60737e;--line:#dce7e7;--bg:#f3f7f7;--teal:#00877c;--deep:#063e47;--gold:#eab957;--red:#b33948;--soft:#eaf5f3}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Cairo,system-ui,sans-serif;font-size:14px;line-height:1.55}button,input,select{font:inherit}button{cursor:pointer}a{color:inherit;text-decoration:none}[hidden]{display:none!important}
.topbar{position:sticky;top:0;z-index:1000;background:#062f38;color:white;padding:12px max(20px,calc((100vw - 1450px)/2));display:flex;align-items:center;justify-content:space-between;gap:18px;box-shadow:0 8px 24px #092e3817}.brand{display:flex;gap:12px;align-items:center;font-size:19px;font-weight:800;line-height:1.1}.brand small{display:block;color:#a9c8ca;font-size:11px;margin-top:5px;font-weight:600}.brandmark{height:38px;width:38px;border:1px solid #6d9da2;border-radius:12px;display:grid;place-items:center}.top-actions{display:flex;align-items:center;gap:13px}.soft-link{font-size:12px;color:#d4f1ed}.pill,.badge{display:inline-block;border-radius:30px;background:#d7efe9;color:#00665d;font-size:11px;font-weight:800;padding:5px 12px}.topbar .pill{background:#14545a;color:#d9f5eb}.pill.warn{background:#733938;color:#fff}.shell{max-width:1450px;margin:auto;padding:26px 22px 50px}.heading{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:22px}.heading h1{margin:0;font-size:30px;line-height:1.25}.heading p{margin:6px 0 0}.heading-right{display:flex;align-items:center;gap:16px}.eyebrow{color:var(--teal);font-size:11px;letter-spacing:.2px;font-weight:800}.muted,.hint,.tiny{color:var(--muted)}.tiny{font-size:11px}.hint{font-size:11px;line-height:1.8;margin:9px 0}.tabs{display:flex;gap:6px;border-bottom:1px solid var(--line);margin-bottom:20px;overflow:auto}.tabs button{border:0;background:none;color:var(--muted);font-weight:800;padding:12px 19px;white-space:nowrap}.tabs button.selected{color:var(--deep);border-bottom:3px solid var(--gold)}.card{background:white;border:1px solid var(--line);border-radius:18px;padding:20px;box-shadow:0 8px 24px #173a3d09;margin-bottom:18px;min-width:0}.card h2{margin:0 0 14px;font-size:17px}.card h3{margin:10px 0;font-size:14px}.card-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}.card-title h2{margin:0}.control-grid{display:grid;grid-template-columns:minmax(360px,.85fr) minmax(360px,1.15fr);gap:18px}.dual-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:18px}.public-grid{display:grid;grid-template-columns:minmax(400px,1.45fr) minmax(320px,1fr);gap:18px}.entry-card{border-top:4px solid var(--gold)}.live-card{border-top:4px solid var(--teal)}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.card label,.login-box label{display:block;font-size:12px;font-weight:800;margin-bottom:11px}.card input:not([type=checkbox]):not([type=file]),.card select,.login-box input,.filters input,.filters select{display:block;width:100%;background:#fbfdfd;border:1px solid #cfdede;border-radius:10px;padding:10px 11px;color:var(--ink);outline:0;margin-top:4px;min-width:0}.card input:focus,.card select:focus,.login-box input:focus{border-color:var(--teal);box-shadow:0 0 0 3px #00877c1c}.entry-card #car-number{font-size:29px;font-weight:800;letter-spacing:2px;padding:13px}.card input[type=file]{display:block;max-width:100%;margin:9px 0 12px}.check{display:flex!important;align-items:center;gap:8px}.check input{accent-color:var(--teal)}button,.button{border:0;background:var(--deep);color:white;border-radius:10px;padding:10px 17px;font-size:12px;font-weight:800;display:inline-block}.button:hover,button:hover{filter:brightness(1.09)}.button.light,.secondary{background:var(--soft);color:var(--deep)}button.quiet{background:transparent;color:var(--teal);padding:6px 9px}.topbar button.quiet{color:#f4efcb}.primary{background:var(--teal)}.wide{width:100%;font-size:15px;padding:12px}.keycap{font-size:12px;color:#6c8790;border:1px solid var(--line);border-radius:6px;padding:3px 9px;white-space:nowrap}.button-row{display:flex;flex-wrap:wrap;gap:9px}.feedback{min-height:22px;margin:7px 0;color:#00786b;font-weight:700}.feedback.bad,.error{color:var(--red)}.success{color:#00786b}.queue-bar{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);font-size:11px;color:var(--muted);padding-top:7px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.stat{border:1px solid var(--line);border-radius:12px;padding:10px;background:#f8fbfa}.stat strong{font-size:22px;display:block;line-height:1.4}.stat span{font-size:11px;color:var(--muted)}.missing-list{display:flex;gap:6px;flex-wrap:wrap;align-content:start;padding-top:16px;max-height:142px;overflow:auto}.missing-list b{padding:3px 9px;border:1px solid #dfebeb;border-radius:7px;background:#f7faf9;font-size:12px}.map{height:410px;border-radius:12px;background:#e6efed;position:relative;z-index:0}.public-map{height:540px}.recent-list{max-height:430px;overflow:auto}.recent-row,.simple-row,.public-row{border-bottom:1px solid var(--line);padding:9px 3px;display:flex;align-items:center;justify-content:space-between;gap:10px}.recent-row:last-child,.simple-row:last-child,.public-row:last-child{border:0}.recent-row strong,.public-row strong{font-size:15px}.recent-row small,.simple-row small,.public-row small{color:var(--muted);display:block;font-size:10px}.recent-row button,.simple-row button{background:var(--soft);color:var(--deep);padding:5px 8px;font-size:10px}.table-wrap{overflow:auto}.table-wrap table{border-collapse:collapse;width:100%;font-size:12px;text-align:right}.table-wrap th,.table-wrap td{border-bottom:1px solid var(--line);padding:10px 12px;white-space:nowrap}.table-wrap th{background:#f0f7f5;position:sticky;top:0;color:#46646b}.table-wrap td:first-child,.table-wrap th:first-child{position:sticky;right:0;background:white;z-index:1}.table-wrap th:first-child{background:#f0f7f5}.table-wrap button{background:transparent;color:var(--teal);padding:2px 5px;font-size:11px}.table-wrap .blank{color:#9cabad}.simple-list{max-height:310px;overflow:auto;margin-top:12px}.simple-row span{min-width:0}.simple-row button{flex:none}.filters{display:flex;align-items:center;gap:20px;flex-wrap:wrap}.filters label{min-width:180px;margin:0}.filters .muted{flex:1;min-width:260px}.public-cars{max-height:565px;overflow:auto}.public-row{align-items:start}.public-row.active{background:#eaf5f3;border-radius:9px;padding:9px}.public-row .car-num{display:inline-grid;place-items:center;background:#073d47;color:white;border-radius:9px;width:38px;height:38px;margin-left:10px;flex:none;font-weight:800}.public-row .car-info{flex:1}.public-row .time-info{text-align:left;font-size:11px;color:#49656b}.car-icon{border:0;background:transparent}.car-icon span{display:grid;place-items:center;background:#053e48;color:white;border:2px solid var(--gold);border-radius:50%;width:38px;height:38px;box-shadow:0 3px 8px #0005;font-size:12px;font-weight:800}.login-box{max-width:450px;margin:9vh auto;padding:30px;background:white;border:1px solid var(--line);border-top:5px solid var(--gold);border-radius:20px;box-shadow:0 15px 40px #082d3812}.login-box h1{margin:0}.login-box p{color:var(--muted)}.login-box button{width:100%}.toast{position:fixed;bottom:20px;left:20px;background:var(--deep);color:white;padding:12px 18px;border-radius:10px;z-index:2000;box-shadow:0 8px 25px #0002}hr{border:0;border-top:1px solid var(--line);margin:20px 0}summary{cursor:pointer;color:var(--teal);font-weight:700;font-size:11px;margin:8px 0}details[open]{padding:9px;border:1px dashed var(--line);border-radius:9px;margin:8px 0}
@media(max-width:960px){.control-grid,.dual-grid,.public-grid{grid-template-columns:1fr}.map{height:370px}.public-map{height:440px}.heading{align-items:start}.shell{padding:20px 12px}.topbar{padding:10px 12px}}@media(max-width:560px){.heading h1{font-size:23px}.heading-right{display:none}.form-grid{grid-template-columns:1fr}.top-actions .soft-link{display:none}.stats{grid-template-columns:repeat(3,1fr)}.filters .muted{min-width:0}.card{padding:15px}}
.pending-list{max-height:125px;overflow:auto}.pending-list:empty{display:none}.pending-list .recent-row{color:#8b5d19}
.touch-panel{border-top:4px solid var(--gold)}.touch-stage-list{display:flex;gap:8px;overflow-x:auto;padding:4px 0 12px}.touch-stage-list button{min-height:52px;min-width:135px;background:#eaf5f3;color:var(--deep);font-size:15px;white-space:nowrap}.access-points{max-height:390px;overflow:auto;border:1px solid var(--line);padding:10px;border-radius:10px}.access-points label{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line);padding:8px;margin:4px;border-radius:8px;min-height:42px}.access-points strong{display:block;margin:10px 2px 3px}.access-points input{accent-color:var(--teal)}@media(max-width:600px){.touch-panel .card-title{display:block}}

/* Compact touch matrix: rows are points, columns are cars. */
.touch-stage-list button[aria-pressed="true"]{background:#063e47;color:#fff;box-shadow:inset 0 -4px 0 var(--gold),0 2px 8px #063e4733;outline:2px solid #063e47;outline-offset:1px}
.stage-indicator{display:inline-block;margin:0 0 4px;background:#d9eee9;color:#063e47;border-radius:8px;padding:6px 12px;font-weight:800}
.touch-instruction{margin:5px 0;color:var(--muted);font-size:12px}
.touch-points{display:block}.touch-matrix-wrap{overflow:auto;max-height:68vh;border:1px solid var(--line);border-radius:12px;overscroll-behavior:contain}
.touch-matrix{border-collapse:separate;border-spacing:0;width:100%;text-align:right}.touch-matrix th,.touch-matrix td{padding:4px;border-bottom:1px solid #e2eceb;white-space:nowrap;text-align:center}
.touch-matrix thead th{position:sticky;top:0;background:#e9f3f1;z-index:2;font-size:12px;min-width:76px;height:39px}
.touch-matrix tbody th{position:sticky;right:0;background:#fff;z-index:1;text-align:right;min-width:152px;max-width:190px;white-space:normal;line-height:1.3;padding:7px 9px}
.touch-matrix thead th:first-child{right:0;z-index:3;min-width:132px}.touch-matrix tbody th small{display:block;font-size:10px;color:var(--muted);margin-top:3px}
.touch-matrix tbody tr.timing th{background:#fff7df}.touch-matrix tbody tr.timing td{background:#fffcf5}
.touch-matrix .point-time{font-size:10px;margin:3px 0 0}.touch-matrix .point-time summary{color:var(--teal);font-weight:800}.touch-matrix .point-time[open]{padding:4px}.touch-matrix .point-time input{width:170px!important;font-size:10px!important;padding:4px!important;direction:ltr}.touch-matrix .point-time small{font-size:9px}
.touch-matrix .touch-car{width:76px;min-height:58px;padding:3px 2px;border-radius:8px;background:var(--teal);color:white;font-size:17px;line-height:1.15;touch-action:manipulation}
.touch-matrix .touch-car small{display:block;font-size:9px;font-weight:700;letter-spacing:-.3px;margin-top:2px}.touch-matrix .touch-car.done{background:#d6ebe4;color:#164e47}.touch-matrix .touch-car.pending{background:#f5e6bb;color:#665014}.touch-matrix .touch-car:disabled{cursor:default;opacity:.82}
.touch-matrix .touch-car .touch-car-point{white-space:normal;line-height:1.05;max-height:22px;overflow:hidden;overflow-wrap:anywhere}
.touch-matrix .touch-car:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.map.leaflet-container{background-color:#e6f0ea;background-image:linear-gradient(0deg,#a2baaa38 1px,transparent 1px),linear-gradient(90deg,#a2baaa38 1px,transparent 1px);background-size:48px 48px}
.map-health{font-size:12px;font-weight:700;color:#795021;margin:6px 0}.point-label.leaflet-tooltip{background:#fffefa;color:#153f48;border:1px solid #8ea8a5;border-radius:6px;box-shadow:0 2px 4px #1233;font:700 11px Cairo,system-ui,sans-serif;padding:2px 6px;white-space:nowrap}.point-label.leaflet-tooltip:before{display:none}
.map-title-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end}.map-style-picker{display:flex!important;align-items:center;gap:6px;margin:0!important;white-space:nowrap}.map-style-picker select{width:auto!important;max-width:245px;margin:0!important;padding:6px 9px!important;font-size:11px!important}.map-style-picker select option:disabled{color:#888}
.car-icon{background:transparent;border:0}.rally-car-marker{width:56px;height:65px;position:relative;filter:drop-shadow(0 2px 3px #1237)}.rally-car-marker svg{width:56px;height:56px;display:block;fill:var(--car-color);stroke:#fff;stroke-width:1.5;stroke-linejoin:round}.rally-car-marker .window{fill:#244456;stroke:#bce6dd}.rally-car-marker .wheel{fill:#17232b;stroke:none}.rally-car-marker .shine{fill:none;stroke:#ffebba;stroke-width:2}.rally-car-marker b{position:absolute;bottom:1px;left:50%;transform:translateX(-50%);background:#fff;border:2px solid var(--car-color);border-radius:7px;min-width:30px;text-align:center;font:800 12px system-ui,sans-serif;line-height:19px;color:#17303a;white-space:nowrap;padding:0 2px}
.marker-preview{display:flex;align-items:center;min-height:78px;padding:8px 15px;margin-bottom:11px;border:1px solid var(--line);border-radius:10px;background:#f2f8f5}.marker-preview small{color:var(--muted);margin-right:15px}
.marker-list-preview{display:flex;align-items:center;gap:9px}.marker-list-preview .rally-car-marker{flex:none}
.card input[type=color]{width:70px!important;height:40px!important;padding:4px!important}
@media(max-width:600px){.touch-matrix-wrap{max-height:65vh}.touch-matrix .touch-car{min-height:59px;width:72px}}
.danger-zone{border-color:#e8c9cc;border-top:4px solid var(--red)}.danger-zone .hint{font-size:12px}.danger-button{background:var(--red)}.danger-button:disabled{opacity:.6;cursor:wait}
