:root{--green:#123b27;--green2:#1d5b3a;--cream:#f6edd9;--card:#fffaf0;--muted:#66756d;--line:#e3d6bd;--orange:#df8132;--danger:#a84835;--blue:#2067bd;--shadow:0 12px 30px rgba(47,35,15,.12);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#173426;background:var(--cream);}
*{box-sizing:border-box;}
body{margin:0;background:linear-gradient(180deg,#fbf5e8,#f4ead3);color:#173426;}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.65rem 1rem;background:var(--green);color:#fff;position:sticky;top:0;z-index:70;}
.brand-block{min-width:0;}
.kicker{text-transform:uppercase;letter-spacing:.08em;font-weight:800;opacity:.8;font-size:.78rem;}
h1{margin:.02rem 0 0;font-size:1.25rem;line-height:1.05;}
h2,h3{margin:.25rem 0 .5rem;line-height:1.1;}
p{line-height:1.45;}
.build{font-size:.68rem;color:rgba(255,255,255,.72);font-weight:700;margin-top:.18rem;white-space:nowrap;}
.header-tabs{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;justify-content:flex-end;}
.tab{border:1px solid rgba(255,255,255,.35);border-radius:999px;padding:.46rem .78rem;background:rgba(255,255,255,.08);color:#fff;font-weight:800;font-size:.88rem;cursor:pointer;}
.tab.active{background:#fffaf0;color:#123b27;border-color:#fffaf0;}
main{max-width:1500px;margin:0 auto;padding:.85rem;}
.mode{display:none;}
.mode.active{display:block;}
.hidden{display:none!important;}
.intro-card{max-width:760px;background:var(--green2);color:#fff;border-radius:18px;padding:1.25rem 1.45rem;box-shadow:var(--shadow);margin:.75rem auto 1.1rem;}
.public-intro h2{font-size:1.45rem;}
.public-intro p{font-size:1rem;margin-bottom:0;}
.filter-bar{max-width:1080px;margin:0 auto .9rem;display:grid;grid-template-columns:minmax(220px,1.5fr) repeat(3,minmax(130px,.7fr));gap:.65rem;align-items:end;background:rgba(255,250,240,.78);border:1px solid var(--line);border-radius:18px;padding:.75rem;box-shadow:0 8px 20px rgba(47,35,15,.08);}
.filter-search-wrap label,.filter-select-wrap label{display:block;font-weight:900;font-size:.78rem;margin:0 0 .28rem;color:#315342;}
.filter-search-wrap input,.filter-select-wrap select{width:100%;border:1px solid var(--line);border-radius:12px;background:#fffaf0;padding:.55rem .65rem;font:inherit;color:#173426;}
.filter-chip-row{grid-column:1/-1;display:flex;gap:.4rem;flex-wrap:wrap;align-items:center;}
.filter-chip{border:1px solid var(--line);border-radius:999px;background:#fffaf0;padding:.32rem .62rem;font-weight:800;font-size:.78rem;color:#173426;cursor:pointer;}
.filter-chip.active{background:#1d5b3a;color:#fff;border-color:#1d5b3a;}
.results-summary{max-width:1080px;margin:.35rem auto .65rem;color:var(--muted);font-size:.9rem;font-weight:800;}
.route-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1rem;max-width:1080px;margin:0 auto;}
.route-card{background:var(--card);border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:var(--shadow);display:flex;flex-direction:column;min-height:100%;}
.route-card-thumb{height:132px;position:relative;background:linear-gradient(135deg,#8eb0aa,#f0a052);overflow:hidden;}
.route-card-thumb:before{content:"";position:absolute;left:-5%;right:-5%;bottom:0;height:55%;background:linear-gradient(175deg,transparent 0 35%,#173d2b 36% 58%,#214b38 59% 100%);opacity:.95;}
.route-card-thumb:after{content:"";position:absolute;left:12%;right:12%;bottom:22%;height:5px;border-radius:999px;background:rgba(255,250,240,.9);transform:rotate(-2deg);}
.route-card-body{padding:1rem;display:flex;flex-direction:column;gap:.45rem;flex:1;}
.route-card h3{font-size:1.18rem;margin:0;}
.route-card p{color:var(--muted);font-size:.95rem;margin:.1rem 0 .25rem;}
.card-meta{display:flex;gap:.35rem;flex-wrap:wrap;}
.pill-row{display:flex;flex-wrap:wrap;gap:.35rem;margin:.35rem 0;}
.pill{display:inline-flex;align-items:center;border-radius:999px;background:#efe3c8;padding:.25rem .55rem;font-size:.78rem;font-weight:800;color:#385044;}
.pill.warning{background:#f5dccd;color:#6f3725;}
.button-row{display:flex;flex-wrap:wrap;align-items:center;gap:.55rem;margin-top:auto;}
.button-row.compact{gap:.4rem;}
button,.link-button{border:1px solid var(--line);border-radius:999px;padding:.62rem .9rem;background:#fffaf0;color:#143c29;font-weight:800;text-decoration:none;cursor:pointer;}
button:disabled{opacity:.45;cursor:not-allowed;}
button.primary,.primary{background:var(--orange);border-color:var(--orange);color:#12291c;}
button.secondary,.secondary{background:#fffaf0;color:#123b27;}
button.secondary.active-soft{background:#e9dcc2;border-color:#d9c79f;}
button.danger{border-color:#e6c7bd;color:var(--danger);}
button.tiny{padding:.25rem .55rem;font-size:.78rem;margin-left:.35rem;}
.wide{width:100%;}
.route-page{max-width:none;margin:0;padding:.25rem 0 0;}
.route-page-topbar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:1rem;align-items:start;background:rgba(255,250,240,.92);border:1px solid var(--line);border-radius:18px;padding:.9rem;box-shadow:var(--shadow);margin:.5rem 0 .75rem;}
.route-title-block h2{font-size:1.45rem;margin:0;}
.route-title-block p{margin:.35rem 0 0;color:var(--muted);}
.route-status-line{font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:#6e7f74;font-weight:900;margin-bottom:.15rem;}
.route-top-actions{display:flex;gap:.45rem;align-items:center;justify-content:flex-end;flex-wrap:wrap;}
.route-workspace{display:grid;grid-template-columns:340px minmax(0,1fr);gap:.85rem;height:calc(100vh - 150px);min-height:640px;}
.route-sidebar{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:.8rem;overflow:auto;}
.route-stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:.45rem;margin-bottom:.65rem;}
.stat-box{background:#efe3c8;border-radius:14px;padding:.55rem .65rem;}
.stat-value{display:block;font-weight:950;font-size:1.05rem;}
.stat-label{display:block;font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:#66756d;font-weight:900;}
.sidebar-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:.3rem;margin:.65rem 0;}
.sidebar-tab{padding:.45rem .35rem;font-size:.82rem;border-radius:999px;}
.sidebar-tab.active{background:var(--green2);color:#fff;border-color:var(--green2);}
.sidebar-content{font-size:.92rem;}
.segment-list{display:flex;flex-direction:column;gap:.45rem;}
.segment-item{border:1px solid var(--line);background:#fffaf0;border-radius:12px;padding:.55rem;cursor:pointer;}
.segment-item.active{border-color:#df8132;background:#fff0df;box-shadow:0 0 0 2px rgba(223,129,50,.18);}
.segment-title{font-weight:950;}
.segment-meta{font-size:.82rem;color:#66756d;font-weight:800;margin-top:.18rem;}
.route-map-area{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);overflow:hidden;display:flex;flex-direction:column;min-width:0;}
.map-toolbar-public{display:flex;align-items:center;justify-content:flex-end;gap:.45rem;padding:.55rem .65rem;border-bottom:1px solid var(--line);background:#fffaf0;}
#map-mode-label{margin-right:auto;font-weight:950;color:#173426;}
.public-map{height:460px;border-radius:14px;border:1px solid var(--line);overflow:hidden;background:#eee;}
.route-map-large{flex:1;height:auto;border:0;border-radius:0;min-height:500px;}
.map-note{font-size:.82rem;color:#66756d;padding:.45rem .65rem;border-top:1px solid var(--line);background:#fffaf0;}
.editor-shell{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:1rem;align-items:start;}
.editor-map-wrap{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);overflow:hidden;position:sticky;top:74px;}
.editor-toolbar{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.55rem .7rem;background:#fffaf0;border-bottom:1px solid var(--line);}
.compact-session-toolbar{min-height:48px;}
.session-status{font-weight:900;font-size:.96rem;line-height:1.2;}
.toolbar-actions{display:flex;gap:.4rem;flex-wrap:nowrap;justify-content:flex-end;align-items:center;}
.compact-toolbar-actions button{padding:.45rem .7rem;font-size:.9rem;white-space:nowrap;}
.more-menu-wrap{position:relative;}
.more-menu{position:absolute;right:0;top:calc(100% + .35rem);background:#fffaf0;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:12px;padding:.4rem;z-index:200;min-width:180px;}
.more-menu button{width:100%;border:0;border-radius:8px;text-align:left;background:transparent;padding:.6rem .7rem;}
.more-menu button:hover{background:#f4ead3;}
.menu-danger{color:var(--danger);font-weight:900;}
.editor-map{height:calc(100vh - 150px);min-height:560px;background:#eee;}
.editor-map.waiting-for-click{cursor:crosshair;outline:4px solid rgba(223,129,50,.35);outline-offset:-4px;}
.editor-panel{display:flex;flex-direction:column;gap:1rem;position:sticky;top:74px;max-height:calc(100vh - 90px);overflow:auto;}
.panel-card{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:1rem;}
.panel-card h2{font-size:1.2rem;}
.display-card h2{margin-bottom:.8rem;}
.layer-group-title{font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:#66756d;font-weight:950;margin:.7rem 0 .35rem;}
.layer-row{display:flex;align-items:center;justify-content:space-between;gap:.75rem;border:1px solid #eadfc9;border-radius:12px;padding:.48rem .55rem;margin:.35rem 0;background:#fffaf0;cursor:pointer;min-height:42px;}
.layer-row>span:first-child{display:flex;align-items:center;gap:.4rem;font-weight:900;}
.layer-row input{position:absolute;opacity:0;pointer-events:none;}
.switch-ui{width:42px;height:24px;border-radius:999px;background:#d7cab2;border:1px solid #c8b994;position:relative;flex:0 0 auto;transition:.16s;}
.switch-ui:before{content:"";position:absolute;width:18px;height:18px;border-radius:50%;left:2px;top:2px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.22);transition:.16s;}
.layer-row input:checked + .switch-ui{background:#1d5b3a;border-color:#1d5b3a;}
.layer-row input:checked + .switch-ui:before{transform:translateX(18px);}
.swatch{width:13px;height:13px;border-radius:3px;display:inline-block;background:#777;}
.swatch-source{background:#2067bd;}
.swatch-route{background:#1f7a3e;}
.swatch-segment{background:#4b6f9e;}
.swatch-node{border-radius:50%;background:#fff;border:2px solid #222;}
.hint,.muted{color:var(--muted);}
.field{margin:.75rem 0;}
.field label{display:block;font-weight:900;margin-bottom:.25rem;}
input,select,textarea{font:inherit;border:1px solid var(--line);border-radius:10px;background:#fffaf0;color:#173426;padding:.55rem .65rem;}
textarea{width:100%;min-height:84px;resize:vertical;}
.short-textarea{min-height:46px;}
.selector-filter{width:100%;margin-bottom:.35rem;}
.selected-readout,.readout{border:1px solid var(--line);border-radius:10px;background:#f9f1df;padding:.5rem;margin-top:.35rem;word-break:break-word;}
.step-row{display:flex;gap:.35rem;flex-wrap:wrap;margin:.6rem 0;}
.step{font-size:.78rem;font-weight:900;border:1px solid var(--line);border-radius:999px;padding:.25rem .55rem;color:#66756d;background:#fffaf0;}
.step.active{background:var(--green2);color:#fff;border-color:var(--green2);}
.status-box{border:1px solid #cddfce;background:#edf7ec;border-radius:10px;padding:.55rem .65rem;margin:.55rem 0;font-weight:800;}
.endpoint-box{font-weight:700;}
.pending-item{border:1px solid var(--line);border-radius:12px;padding:.55rem;margin:.45rem 0;background:#fffaf0;}
.label-tip{background:#fffaf0;border:1px solid #b9a98a;border-radius:8px;color:#173426;font-weight:900;padding:.15rem .35rem;box-shadow:0 4px 10px rgba(0,0,0,.12);}
.leaflet-tooltip.segment-highlight-tip{background:#fff0df;border:1px solid #df8132;color:#173426;font-weight:950;border-radius:8px;}
@media(max-width:980px){.filter-bar{grid-template-columns:1fr 1fr;}.route-workspace{grid-template-columns:1fr;height:auto;}.route-sidebar{order:2;max-height:none;}.route-map-area{min-height:70vh;}.editor-shell{grid-template-columns:1fr;}.editor-panel{position:static;max-height:none;}.editor-map-wrap{position:static;}.editor-map{height:70vh;}.route-page-topbar{grid-template-columns:1fr;}.route-top-actions{justify-content:flex-start;}}
@media(max-width:640px){main{padding:.55rem;}.topbar{align-items:flex-start;}.header-tabs{justify-content:flex-start;}.filter-bar{grid-template-columns:1fr;}.route-grid{grid-template-columns:1fr;}.route-stat-grid{grid-template-columns:1fr;}.toolbar-actions{flex-wrap:wrap;justify-content:flex-start;}.editor-toolbar{align-items:flex-start;flex-direction:column;}.route-map-large{min-height:68vh;}}
