:root { color-scheme: light; --ink: #263039; --muted: #75808a; --paper: #eef0f2; --white: #fff; --line: #d8dde1; --red: #d93632; --red-dark: #b72927; --green: #4d9a62; font-family: 'DM Sans', sans-serif; }
* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
.builder-topbar { display: flex; height: 62px; align-items: center; gap: 22px; padding: 0 22px; color: #fff; background: #347e4d; box-shadow: 0 2px 6px rgba(30,48,35,.18); }
.builder-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; text-decoration: none; }
.builder-brand::first-letter { display: grid; }
.builder-brand span { opacity: .75; font-family: 'DM Sans', sans-serif; font-size: 9px; letter-spacing: 1.2px; }
.builder-kicker { color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.builder-topbar .builder-kicker { color: rgba(255,255,255,.72); }
h1, h2 { margin: 3px 0 0; font-family: 'Manrope', sans-serif; line-height: 1; }
h1 { font-size: 21px; } h2 { font-size: 17px; }
.back-link { margin-left: auto; padding: 8px 12px; border: 1px solid rgba(255,255,255,.5); border-radius: 2px; color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; }
.back-link:hover { background: rgba(0,0,0,.12); }
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; min-height: calc(100vh - 62px); }
.builder-map-section { min-width: 0; padding: 18px; }
.builder-map-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 11px; }
.builder-map-heading > span { color: var(--muted); font-size: 12px; }
.builder-map { height: calc(100vh - 125px); min-height: 520px; border: 1px solid #ccd4d8; background: #cad7cf; box-shadow: 0 1px 3px rgba(30,45,55,.09); }
.builder-stop-marker { display: block; width: 15px; height: 15px; border: 3px solid #fff; border-radius: 50%; background: #2876a6; box-shadow: 0 1px 4px rgba(0,0,0,.38); }
.builder-placement-marker { display: block; width: 24px; height: 24px; border: 3px solid #fff; border-radius: 50% 50% 50% 4px; background: #e3ae35; box-shadow: 0 2px 6px rgba(0,0,0,.42); transform: rotate(-45deg); animation: placement-pulse 1.4s ease-in-out infinite; }
@keyframes placement-pulse { 50% { box-shadow: 0 0 0 6px rgba(227,174,53,.24), 0 2px 6px rgba(0,0,0,.42); } }
.builder-sidebar { padding: 18px 14px; border-left: 1px solid var(--line); background: #fafafa; overflow: auto; }
.builder-panel { padding: 15px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); }
.builder-panel--route { margin-top: 12px; }
.group-manager { margin: -2px 0 16px; padding-bottom: 12px; border-bottom: 1px solid #edf0f1; }
.group-manager-heading { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.builder-group-list { display: grid; max-height: 150px; gap: 4px; overflow: auto; }
.builder-group-option { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 7px; border: 1px solid #e1e6e8; border-radius: 2px; }
.builder-group-option > span { display: grid; min-width: 0; gap: 2px; }
.builder-group-option strong { overflow-wrap: anywhere; font-size: 11px; }
.builder-group-option small, .group-empty { color: var(--muted); font-size: 10px; }
.group-empty { margin: 5px 0; }
.panel-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.tool-badge { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 3px; color: #fff; background: var(--red); font-size: 19px; }
.tool-badge--route { font-size: 16px; }
.builder-sidebar input, .builder-sidebar select { width: 100%; height: 35px; margin-bottom: 8px; padding: 0 9px; border: 1px solid #d5dce0; border-radius: 2px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; }
.builder-sidebar input:focus, .builder-sidebar select:focus { border-color: var(--red); box-shadow: 0 0 0 2px #f8e4e3; }
.field-row { display: flex; gap: 6px; } .field-row > * { min-width: 0; flex: 1; }
.builder-button { width: 100%; height: 35px; border: 0; border-radius: 2px; color: #fff; background: var(--red); font-size: 12px; font-weight: 700; }
.builder-button:hover { background: var(--red-dark); }
.panel-help { margin: -2px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.builder-stop-list { display: grid; max-height: 360px; gap: 5px; overflow: auto; }
.stop-group-section { border: 1px solid #e1e6e8; border-radius: 2px; background: #fff; }
.stop-group-section > summary { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; color: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; }
.stop-group-section > summary small { display: grid; min-width: 19px; height: 19px; place-items: center; border-radius: 2px; color: var(--red); background: #f8e4e3; font-size: 10px; }
.stop-group-stops { display: grid; gap: 4px; padding: 0 5px 5px; }
.builder-stop-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 1px solid #e1e6e8; border-radius: 2px; font-size: 12px; }
.stop-option-info, .route-option-info { display: grid; min-width: 0; gap: 3px; }
.builder-stop-option small, .builder-route-option small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.item-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.item-actions button { padding: 4px 6px; border: 1px solid #d5dce0; border-radius: 2px; color: var(--red); background: #fff; font-size: 10px; font-weight: 700; }
.item-actions button:hover { color: #fff; background: var(--red); }
.builder-stop-option button:hover { color: #fff; background: var(--red); }
.existing-routes-heading { margin: 14px 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.builder-route-list { display: grid; max-height: 180px; gap: 5px; overflow: auto; }
.builder-route-option { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid #e1e6e8; border-radius: 2px; font-size: 11px; }
.route-color { width: 11px; height: 28px; border-radius: 1px; }
.builder-route-option strong { overflow-wrap: anywhere; }
.builder-route-option h3, #builder-route-form h3 { margin: 11px 0 7px; font-family: 'Manrope', sans-serif; font-size: 13px; }
.builder-button--secondary { margin-top: 5px; border: 1px solid var(--line); color: var(--ink); background: #fff; }
.builder-button--secondary:hover { border-color: var(--red); color: var(--red); background: #fff; }
.builder-button.is-hidden { display: none; }
.builder-stop-option button:hover { color: #fff; background: var(--red); }
.route-sequence-title { display: flex; justify-content: space-between; margin: 15px 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.route-sequence-title strong { color: var(--red); font-weight: 700; }
.route-sequence { display: grid; gap: 4px; min-height: 33px; margin: 0 0 12px; padding: 0; list-style-position: inside; }
.route-sequence li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-left: 3px solid var(--red); color: var(--ink); background: #fff4f3; font-size: 12px; }
.sequence-stop { display: flex; min-width: 0; align-items: center; gap: 7px; }
.sequence-stop b { color: var(--red); font-size: 10px; }
.sequence-actions { display: flex; flex: 0 0 auto; gap: 2px; }
.route-sequence .sequence-actions button { width: 25px; height: 24px; padding: 0; border: 1px solid #ead5d3; border-radius: 2px; color: #59656c; background: #fff; font-size: 13px; }
.route-sequence .sequence-actions button:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.route-sequence .sequence-actions button:disabled { cursor: default; opacity: .4; }
.builder-message { min-height: 18px; margin: 10px 3px; color: var(--green); font-size: 12px; }
@media (max-width: 850px) { .builder-topbar { height: auto; min-height: 62px; flex-wrap: wrap; padding: 12px 15px; } .back-link { margin-left: auto; } .builder-layout { display: block; } .builder-map-section { padding: 12px; } .builder-map { height: 55vh; min-height: 400px; } .builder-sidebar { border-top: 1px solid var(--line); border-left: 0; } }

body { display: flex; height: 100dvh; flex-direction: column; overflow: hidden; }
.builder-topbar { flex: 0 0 auto; }
.builder-layout { min-height: 0; grid-template-rows: minmax(0, 1fr); flex: 1 1 auto; overflow: hidden; }
.builder-map-section { display: flex; min-height: 0; flex-direction: column; overflow: hidden; }
.builder-map { height: auto; min-height: 0; flex: 1 1 auto; }
.builder-sidebar { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 850px) {
	.builder-layout { display: flex; flex-direction: column; }
	.builder-map-section { min-height: 220px; flex: 0 0 43%; padding: 12px; }
	.builder-map { height: auto; min-height: 0; flex: 1 1 auto; }
	.builder-sidebar { min-height: 0; flex: 1 1 auto; overflow-y: auto; border-top: 1px solid var(--line); border-left: 0; }
}
