:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #697386;
    --border: #dfe4ec;
    --primary: #0b6e4f;
    --primary-dark: #07553e;
    --soft-primary: #e7f4ef;
    --warning-bg: #fff7e6;
    --warning-border: #f0c36b;
    --warning-text: #7a5311;
    --danger-bg: #fff0f0;
    --danger-text: #a12424;
    --shadow: 0 12px 35px rgba(32, 45, 68, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: 74px;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 22px;
}

.brand h1,
.brand p,
.panel h2,
.panel h3 {
    margin: 0;
}

.brand h1 {
    font-size: 18px;
    letter-spacing: 0.03em;
}

.brand p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.module-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--soft-primary);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 12px;
}

.layout {
    flex: 1;
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    min-height: 0;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.panel,
.map-area {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 20px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panel h2 {
    font-size: 24px;
}

.muted,
.route-description,
.mini-panel p {
    color: var(--muted);
    line-height: 1.55;
}

label {
    display: block;
    margin: 20px 0 8px;
    font-size: 13px;
    font-weight: 700;
}

select,
button {
    font: inherit;
}

select {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    outline: none;
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.12);
}

select:disabled {
    opacity: 0.7;
    cursor: wait;
}

.status {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.status.info {
    background: #eef5ff;
    color: #28598d;
}

.status.success {
    background: var(--soft-primary);
    color: var(--primary-dark);
}

.status.error {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.route-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.route-color {
    width: 12px;
    align-self: stretch;
    min-height: 48px;
    border-radius: 99px;
    background: var(--primary);
}

.route-code {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.route-card h3 {
    font-size: 18px;
}

.route-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.route-grid div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfc;
}

.route-grid div:last-child {
    grid-column: 1 / -1;
}

.route-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
}

.route-grid strong {
    font-size: 13px;
}

.warning {
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid var(--warning-border);
    border-radius: 10px;
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: 12px;
    line-height: 1.45;
}

.map-area {
    min-height: 680px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.map-toolbar {
    min-height: 62px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.map-toolbar strong,
.map-toolbar span {
    display: block;
}

.map-toolbar span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.map-toolbar button {
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.map-toolbar button:hover {
    background: var(--primary-dark);
}

#map {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 600px;
    background: #e8eef3;
    z-index: 0;
}

/* Mantiene Leaflet dentro de la tarjeta y evita conflictos de z-index. */
.leaflet-container {
    width: 100%;
    height: 100%;
    font-family: inherit;
}

.hidden {
    display: none !important;
}

footer {
    min-height: 42px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 11px;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .map-area {
        min-height: 600px;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 12px 14px;
    }

    .brand p,
    .module-badge {
        display: none;
    }

    .layout {
        padding: 10px;
        gap: 10px;
    }

    .panel {
        padding: 16px;
    }

    .route-grid {
        grid-template-columns: 1fr;
    }

    .route-grid div:last-child {
        grid-column: auto;
    }

    #map {
        min-height: 500px;
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        padding: 10px 14px;
    }
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.editor-link {
    text-decoration: none;
    color: var(--primary-dark);
    background: var(--soft-primary);
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 12px;
    font-weight: 800;
}
.route-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #edf2f7;
    color: #425466;
    font-size: 11px;
    font-weight: 800;
}
.pill.ok {
    background: #e7f4ef;
    color: #07553e;
}
.pill.pending {
    background: #fff7e6;
    color: #7a5311;
}
.source-line {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}
.stops-block {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.stops-block h4 {
    margin: 0 0 8px;
}
.stops-block ol {
    margin: 0;
    padding-left: 22px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}
.endpoint-wrapper {
    background: transparent;
    border: 0;
}
.endpoint-marker {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
    border: 4px solid #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
}
.endpoint-marker.start {
    background: #0b8f55;
}
.endpoint-marker.end {
    background: #d63b31;
}
.endpoint-label {
    border: 0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18) !important;
    border-radius: 8px !important;
    font-weight: 800;
}
.start-label {
    color: #076b42;
}
.end-label {
    color: #a9251f;
}
/* SEVB: explorador, catálogo local y editor de rutas de Villavicencio. */
:root {
    --bg: #f5f5ee;
    --text: #163c34;
    --muted: #63776f;
    --border: #dde4d9;
    --primary: #176650;
    --primary-dark: #104a3b;
    --soft-primary: #e7efe4;
    --shadow: 0 8px 28px rgba(29, 57, 41, 0.04);
}
body {
    background: radial-gradient(ellipse at top left, #edf1e4 0, transparent 55%), var(--bg);
}
.brand {
    color: inherit;
    text-decoration: none;
}
.brand-mark {
    position: relative;
    background: #174b3c;
    border-radius: 14px;
}
.brand-mark span {
    font-size: 14px;
    position: absolute;
    right: 5px;
    top: 1px;
}
.topbar {
    background: #fcfcf7;
    padding: 18px 30px;
}
.brand h1 {
    letter-spacing: 0.06em;
}
.brand p {
    font-size: 11px;
}
.module-badge {
    font-weight: 600;
}
.layout {
    grid-template-columns: 355px minmax(0, 1fr);
    padding: 24px;
    gap: 24px;
    align-items: start;
}
.panel {
    border-radius: 20px;
    padding: 24px;
}
.panel h2 {
    font-size: 32px;
    line-height: 1.12;
    letter-spacing: -1.1px;
    font-weight: 750;
}
.muted {
    font-size: 13px;
}
.eyebrow {
    font-size: 10px;
    letter-spacing: 0.14em;
}
input,
textarea,
select {
    font: inherit;
    color: var(--text);
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcf8;
    min-height: 44px;
}
textarea {
    resize: vertical;
}
input[type='checkbox'] {
    width: 18px;
    min-height: 18px;
    accent-color: var(--primary);
}
label {
    font-size: 12px;
    margin: 17px 0 7px;
}
select {
    margin-top: 10px;
}
button,
.file-button {
    font: inherit;
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    padding: 10px 13px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 650;
    font-size: 12px;
    text-align: center;
}
button:hover,
.file-button:hover {
    filter: brightness(0.95);
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.secondary {
    background: var(--soft-primary);
    color: var(--primary-dark);
    border: 1px solid #dce6d8;
}
.text-button {
    background: transparent;
    color: var(--muted);
}
.danger {
    color: #ac3932;
}
:focus-visible {
    /* Ámbar oscuro: el anterior (#eaa73d) tenía 2,1:1 contra el blanco; este tiene 4,0:1 (mínimo recomendado para indicadores de foco: 3:1). */
    outline: 3px solid #b86e00;
    outline-offset: 3px;
}
input:focus,
textarea:focus {
    border-color: var(--primary);
    outline: 2px solid #c4dbc6;
}
button,
.editor-link {
    transition: background var(--motion-fast) ease;
}
.list-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 12px;
    font-size: 12px;
}
.list-heading span {
    background: var(--soft-primary);
    padding: 3px 8px;
    border-radius: 20px;
}
.route-list {
    display: grid;
    gap: 8px;
    max-height: 330px;
    overflow: auto;
    padding: 3px;
}
.route-option {
    display: flex;
    gap: 12px;
    text-align: left;
    background: #f8faf4;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 13px;
    width: 100%;
}
.route-option[aria-pressed='true'] {
    background: #eaf2e3;
    border-color: var(--primary);
    box-shadow: inset 3px 0 var(--primary);
}
.route-option small,
.route-option strong {
    display: block;
}
.route-option small {
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.5;
}
.route-option strong {
    font-size: 13px;
    margin: 3px 0;
}
.route-option-dot {
    flex: 0 0 7px;
    align-self: stretch;
    border-radius: 10px;
}
.empty {
    font-size: 13px;
    color: var(--muted);
    padding: 15px 0;
}
.status {
    font-size: 12px;
    line-height: 1.5;
}
.map-area {
    border-radius: 22px;
    min-height: 700px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 150px);
}
#map,
#editorMap {
    flex: 1;
    min-height: 480px;
    background: #e4eadc;
}
.map-toolbar {
    padding: 17px 20px;
    background: #fcfcf8;
}
.map-toolbar strong {
    font-size: 15px;
}
.toolbar-actions {
    display: flex;
    gap: 8px;
}
.map-toolbar .secondary {
    background: var(--soft-primary);
    color: var(--primary-dark);
}
.map-legend {
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    align-items: center;
    font-size: 11px;
    background: #fcfcf8;
}
.map-legend span,
.map-legend label {
    display: flex;
    gap: 7px;
    align-items: center;
    margin: 0;
    font-size: 11px;
    font-weight: 500;
}
.legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.legend-dot.start,
.journey-dot.start {
    background: #1b865a;
}
.legend-dot.end,
.journey-dot.end {
    background: #c85b43;
}
.map-notice {
    position: absolute;
    bottom: 30px;
    left: 15px;
    right: 15px;
    z-index: 600;
    background: #fff7df;
    border: 1px solid #e8c98c;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    pointer-events: none;
}
.journey {
    margin-top: 24px;
}
.journey > div {
    position: relative;
    padding: 0 0 23px 27px;
    min-height: 55px;
}
.journey > div:first-child:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 15px;
    height: calc(100% - 12px);
    border-left: 1px dashed #b6c6b5;
}
.journey-dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
}
.journey small,
.journey strong {
    display: block;
}
.journey small,
.metrics small {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 5px;
}
.journey strong {
    font-size: 14px;
}
.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 12px;
    background: #f0f4e9;
    padding: 15px;
    gap: 10px;
}
.metrics small,
.metrics strong {
    display: block;
}
.metrics strong {
    font-size: 22px;
    letter-spacing: -0.5px;
}
.route-description {
    font-size: 12px;
}
.route-card > button {
    width: 100%;
    margin-top: 16px;
}
.warning {
    font-size: 12px;
    line-height: 1.6;
}
.warning li {
    margin-left: 12px;
}
.stop-button {
    color: var(--text);
    background: transparent;
    padding: 2px 5px;
    text-align: left;
    min-height: 36px;
}
.stops-block ol {
    padding-left: 20px;
}
.mini-panel p {
    font-size: 12px;
    margin-bottom: 0;
}
.source-line {
    font-size: 11px;
}
.endpoint-label,
.leaflet-tooltip {
    white-space: normal;
    max-width: 240px;
}
.leaflet-tooltip {
    font-size: 11px;
}
.editor-layout {
    display: grid;
    grid-template-columns: 370px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
    align-items: start;
}
.editor-controls {
    overflow: hidden;
}
.editor-controls h2 {
    margin: 0;
    font-size: 29px;
    letter-spacing: -1px;
}
.hint {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.65;
}
.editor-controls fieldset {
    padding: 0;
    border: 0;
    margin: 0;
    min-width: 0;
}
.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 25px 0 15px;
    font-size: 12px;
    font-weight: 700;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}
.section-heading strong {
    color: var(--primary);
    font-size: 10px;
    background: var(--soft-primary);
    padding: 5px 7px;
    border-radius: 6px;
}
.button-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
.button-row > * {
    flex: 1;
    min-width: 0;
}
.file-button {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    text-decoration: none;
}
.editor-metrics {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
    font-size: 11px;
    color: var(--muted);
    padding: 12px;
    background: #f2f5ed;
    border-radius: 10px;
}
.checkbox-label {
    display: flex;
    gap: 8px;
    align-items: center;
    line-height: 1.5;
}
.save-button {
    width: 100%;
    min-height: 48px;
    margin-top: 16px;
}
.vertex-wrapper {
    display: grid;
    place-items: center;
}
.vertex {
    width: 13px;
    height: 13px;
    display: block;
    background: #fff;
    border: 3px solid #176650;
    border-radius: 50%;
    box-shadow: 0 1px 5px #0003;
}
.vertex.selected {
    background: #efb64c;
    border-color: #553b14;
    width: 18px;
    height: 18px;
}
.revision-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.revision-list button {
    text-align: left;
    font-size: 11px;
}
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0 !important;
}
.skip-link {
    position: absolute;
    left: 10px;
    top: -100px;
    z-index: 2000;
    background: #fff;
    color: var(--primary);
    padding: 10px;
}
.skip-link:focus {
    top: 10px;
}
@media (max-width: 1050px) {
    .layout {
        grid-template-columns: 310px minmax(0, 1fr);
        gap: 16px;
        padding: 16px;
    }
    .editor-layout {
        grid-template-columns: 330px minmax(0, 1fr);
        gap: 16px;
        padding: 16px;
    }
    .toolbar-actions {
        flex-wrap: wrap;
    }
    .map-toolbar {
        align-items: flex-start;
    }
    .panel {
        padding: 20px;
    }
}
@media (max-width: 800px) {
    .layout,
    .editor-layout {
        grid-template-columns: 1fr;
    }
    .map-area {
        position: relative;
        top: 0;
        height: 65vh;
        min-height: 500px;
    }
    .editor-map {
        grid-row: 1;
        height: 60vh;
    }
    .editor-controls {
        grid-row: 2;
    }
    .sidebar {
        display: grid;
        grid-template-columns: 1fr;
    }
    .route-list {
        max-height: 240px;
    }
    .map-toolbar span {
        max-width: 230px;
    }
    .topbar {
        padding: 14px 16px;
    }
    .module-badge {
        display: none;
    }
    #map,
    #editorMap {
        min-height: 380px;
    }
    .map-legend {
        gap: 12px;
    }
    .panel h2 {
        font-size: 29px;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

.leaflet-tooltip {
    white-space: nowrap;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trip-panel h2 {
    font-size: 30px;
}
.trip-panel .button-row {
    margin: 8px 0;
}
.trip-panel input {
    font-size: 12px;
}
.trip-options select {
    margin: 0;
}
.place-results,
.trip-results {
    display: grid;
    gap: 8px;
}
.place-option {
    background: #edf3e6;
    color: var(--text);
    text-align: left;
    font-size: 11px;
    line-height: 1.5;
    border: 1px solid var(--border);
}
.trip-option {
    padding: 15px;
    border: 1px solid #d4dfcc;
    border-radius: 12px;
    background: #f8faf4;
}
.trip-option > strong {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
}
.trip-option p {
    font-size: 11px;
    line-height: 1.65;
}
.trip-option button {
    width: 100%;
}
.trip-pin {
    width: 34px;
    height: 34px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #64417a;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    box-shadow: 0 3px 12px #0003;
}
.picking-location {
    cursor: crosshair !important;
}
.button-row button[aria-pressed='true'] {
    background: #176650;
    color: #fff;
}
.trip-panel #swapTrip {
    flex: 0 0 42px;
}
.trip-panel .hint {
    margin-bottom: 0;
}

/* SEVB · interfaz enfocada únicamente en Villavicencio */
.city-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -4px 0 18px;
    padding: 9px 11px;
    border: 1px solid #d8e3d4;
    border-radius: 10px;
    background: #f1f5eb;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .02em;
}
.city-strip strong {
    color: var(--primary-dark);
    font-size: 10px;
}
.compact-actions {
    flex-wrap: wrap;
}
.compact-actions > * {
    flex: 1 1 95px;
}
.rich-place {
    display: grid;
    gap: 2px;
    width: 100%;
}
.rich-place strong,
.rich-place small {
    display: block;
}
.rich-place strong {
    font-size: 11px;
    line-height: 1.35;
}
.rich-place small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 500;
}
.nearby-results {
    display: grid;
    gap: 8px;
    margin-bottom: 4px;
}
.nearby-card {
    display: grid;
    gap: 7px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbf7;
}
.nearby-card strong,
.nearby-card small {
    display: block;
}
.nearby-card strong { font-size: 12px; }
.nearby-card small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.nearby-card button { justify-self: start; }
.trip-option-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.trip-option-heading strong { font-size: 13px; }
.select-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}
.select-action-row select,
.select-action-row input {
    margin: 0;
}
.form-grid {
    display: grid;
    gap: 10px;
}
.form-grid.two {
    grid-template-columns: 1fr 1fr;
}
.form-grid.color-row {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: end;
}
.form-grid label { margin-top: 12px; }
input[type='color'] {
    padding: 4px;
    min-height: 44px;
    cursor: pointer;
}

.places-layout {
    display: grid;
    grid-template-columns: 410px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
    align-items: start;
}
.places-controls h2 {
    margin: 0;
    font-size: 29px;
    letter-spacing: -1px;
}
.places-map {
    position: sticky;
    top: 20px;
    height: calc(100vh - 150px);
    min-height: 700px;
}
#placesMap {
    flex: 1;
    min-height: 520px;
    background: #e4eadc;
}
.catalog-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
    max-height: 420px;
    overflow: auto;
}
.catalog-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbf7;
}
.catalog-place {
    display: grid;
    gap: 3px;
    text-align: left;
    background: transparent;
    color: var(--text);
    padding: 3px;
    min-height: 0;
}
.catalog-place strong { font-size: 11px; }
.catalog-place small { font-size: 9px; color: var(--muted); line-height: 1.4; }
.catalog-row .text-button { padding: 6px 8px; min-height: 0; }

@media (max-width: 1000px) {
    .places-layout { grid-template-columns: 350px minmax(0, 1fr); gap: 16px; padding: 16px; }
}
@media (max-width: 800px) {
    .places-layout { grid-template-columns: 1fr; padding: 10px; }
    .places-map { position: relative; top: 0; height: 58vh; min-height: 460px; grid-row: 1; }
    .places-controls { grid-row: 2; }
    #placesMap { min-height: 360px; }
    .top-actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 520px) {
    .form-grid.two,
    .form-grid.color-row { grid-template-columns: 1fr; }
    .select-action-row { grid-template-columns: 1fr; }
    .trip-option-heading { display: grid; }
}

/* ========================= SEVB · INICIO ========================= */
.home-sevb { background: #f4f6f3; }
.sevb-topbar { position: sticky; top: 0; z-index: 1200; }
.sevb-top-actions { display: flex; align-items: center; gap: 12px; }
.menu-button { width: 46px; height: 46px; border-radius: 12px; display: grid; place-content: center; gap: 5px; padding: 0; }
.menu-button span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 5px; }
.menu-backdrop { position: fixed; inset: 0; background: rgba(16,26,23,.42); z-index: 1390; backdrop-filter: blur(2px); }
.side-menu { position: fixed; top: 0; right: 0; z-index: 1400; width: min(430px, 92vw); height: 100dvh; overflow-y: auto; background: #fff; box-shadow: -20px 0 55px rgba(18,38,32,.2); padding: 22px; transform: translateX(105%); transition: transform var(--motion-normal) var(--ease-standard); }
.side-menu.open { transform: translateX(0); }
.side-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.side-menu-head h2 { margin: 2px 0 0; }
.icon-button { width: 42px; height: 42px; border-radius: 50%; font-size: 26px; line-height: 1; padding: 0; }
.menu-links { display: grid; gap: 8px; margin: 22px 0; }
.menu-links a { padding: 14px 16px; border-radius: 12px; background: #f3f6f4; color: #153b32; text-decoration: none; font-weight: 700; }
.menu-links a:hover { background: #e7f1ed; }
.menu-divider { height: 1px; background: #dfe6e2; margin: 18px 0; }
.menu-route-browser h3 { margin-top: 0; }
.compact-route-list { max-height: 330px; overflow: auto; }
.menu-route-card { margin-top: 16px; padding: 16px; border-radius: 16px; background: #f7f9f7; }
body.menu-open { overflow: hidden; }

.sevb-main { display: grid; grid-template-columns: minmax(390px, 460px) minmax(0, 1fr); min-height: calc(100dvh - 78px); }
.planner-column { padding: 26px 22px 28px 28px; overflow: auto; }
.planner-intro { margin-bottom: 16px; }
.planner-intro h2 { font-size: clamp(1.75rem, 2.5vw, 2.5rem); line-height: 1.05; margin: 6px 0 10px; letter-spacing: -.035em; color: #183c33; }
.planner-intro p:last-child { margin: 0; color: #5b6662; line-height: 1.55; }
.sevb-trip-panel { position: relative; border: 1px solid #dfe7e2; box-shadow: 0 16px 40px rgba(36,70,59,.08); }
.endpoint-block { padding: 2px 0 10px; }
.endpoint-label { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.endpoint-label div { display: grid; }
.endpoint-label small { color: #74807b; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.endpoint-label strong { color: #173c32; }
.endpoint-letter { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: white; }
.endpoint-letter.a { background: #176650; }
.endpoint-letter.b { background: #cb6d2a; }
.sevb-trip-panel input { font-size: 1rem; min-height: 48px; }
.sevb-trip-panel .compact-actions { display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: 7px; margin-top: 8px; }
.endpoint-block + .endpoint-block .compact-actions { grid-template-columns: 1.1fr 1fr; }
.sevb-trip-panel .compact-actions button { min-height: 40px; padding: 8px 9px; font-size: .82rem; }
.map-pick-button[aria-pressed="true"] { background: #173f35; color: white; border-color: #173f35; }
.swap-floating { display: block; margin: -2px auto 8px; width: 42px; height: 42px; border-radius: 50%; padding: 0; font-size: 20px; }
.planner-settings { border-top: 1px solid #e3e8e5; border-bottom: 1px solid #e3e8e5; padding: 10px 0; margin: 5px 0 13px; }
.planner-settings summary { cursor: pointer; font-weight: 700; color: #38544c; }
.planner-settings-grid { display: grid; gap: 9px; padding-top: 11px; }
.planner-settings-grid label:first-child { display: grid; gap: 5px; font-size: .85rem; }
.primary-plan-button { width: 100%; min-height: 52px; font-size: 1rem; font-weight: 800; border-radius: 13px; }
.text-button { border: 0; background: transparent; color: #176650; padding: 8px 0; font-weight: 700; text-decoration: underline; }
.text-button:disabled { opacity: .45; }
.nearby-origin-block { margin-top: 5px; }

.sevb-map-area { position: sticky; top: 78px; height: calc(100dvh - 78px); min-height: 650px; border-left: 1px solid #dfe5e2; }
.sevb-map-area #map { height: calc(100% - 112px); min-height: 500px; }
.sevb-map-toolbar { min-height: 62px; }
.map-help { position: absolute; z-index: 700; left: 18px; bottom: 58px; max-width: 430px; padding: 10px 13px; border-radius: 11px; background: rgba(255,255,255,.94); box-shadow: 0 7px 24px rgba(28,52,44,.15); font-size: .82rem; color: #43554e; pointer-events: none; }
.picking-location { cursor: crosshair !important; }

.results-heading, .alternative-heading { display: grid; gap: 2px; margin: 18px 0 9px; }
.results-heading strong, .alternative-heading strong { color: #193c33; font-size: 1rem; }
.results-heading span, .alternative-heading small { color: #77827e; font-size: .8rem; }
.sevb-result-card { border-left: 5px solid var(--route-color); padding: 14px; border-radius: 14px; background: #fff; box-shadow: 0 6px 20px rgba(28,59,50,.07); margin-bottom: 10px; }
.sevb-result-card.alternative { background: #fafaf8; opacity: .94; }
.result-route-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.result-route-title div { display: grid; min-width: 0; }
.result-route-title strong { overflow-wrap: anywhere; }
.result-route-title small { color: #728079; margin-top: 2px; }
.result-number { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: var(--route-color); color: #fff; font-weight: 800; }
.result-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 12px 0 9px; }
.result-metrics div { padding: 8px; border-radius: 9px; background: #f2f6f3; display: grid; gap: 2px; }
.result-metrics small { color: #75817b; font-size: .7rem; }
.result-metrics strong { color: #1c4338; font-size: .88rem; }
.result-direction { margin: 8px 0; font-size: .78rem; color: #69756f; }
.result-show-button { width: 100%; min-height: 42px; border-radius: 10px; }
.planner-empty { padding: 16px; border-radius: 13px; background: #fff8e8; border: 1px solid #eddcb3; margin-top: 14px; }
.planner-empty strong { color: #6d531d; }
.planner-empty p { margin-bottom: 0; color: #6d6250; font-size: .87rem; line-height: 1.5; }

@media (max-width: 1050px) {
    .sevb-main { grid-template-columns: 390px minmax(0,1fr); }
    .planner-column { padding: 18px 14px; }
}
@media (max-width: 820px) {
    .module-badge { display: none; }
    .sevb-main { display: flex; flex-direction: column; }
    .planner-column { padding: 14px 10px; }
    .sevb-map-area { position: relative; top: 0; height: 64dvh; min-height: 500px; border-left: 0; border-top: 1px solid #dfe5e2; }
    .sevb-map-area #map { height: calc(100% - 108px); }
    .sevb-trip-panel .compact-actions { grid-template-columns: 1fr 1fr; }
    #useMyLocation { grid-column: 1 / -1; }
    .result-metrics { grid-template-columns: 1fr 1fr 1fr; }
    .map-help { left: 10px; right: 10px; bottom: 54px; max-width: none; }
}
@media (max-width: 480px) {
    .sevb-topbar .brand p { display: none; }
    .planner-intro h2 { font-size: 1.8rem; }
    .result-metrics { grid-template-columns: 1fr; }
    .sevb-result-card .trip-option-heading { align-items: flex-start; gap: 8px; }
}

/* Opción mostrada actualmente en el mapa */
.trip-option.selected {
    outline: 3px solid var(--route-color, #176650);
    outline-offset: 2px;
}
.nearby-card.selected {
    outline: 2px solid #176650;
    outline-offset: 2px;
}

/* Búsqueda de direcciones: avisar de ausencia de precisión, sin sugerir calles como casas. */
.address-warning { margin: 10px 0; padding: 12px 14px; border: 1px solid #cfad6a;
  border-radius: 12px; background: #fff7e6; color: #5b430b; line-height: 1.45; font-size: 14px; }

/* V3.4: autocompletado con teclado, lectura y selección accesibles. */
.place-results.suggestion-open { max-height: 315px; overflow-y: auto; overscroll-behavior: contain;
    border-radius: 13px; box-shadow: 0 8px 26px rgba(23,62,49,.09); }
.place-results .autosuggest-option { font-size: .88rem; padding: 11px 13px; margin: 0; }
.place-results .autosuggest-option:hover,
.place-results .autosuggest-option.keyboard-selected { background: #d6e8dd; border-color: #1d735b; }
.place-results .autosuggest-option:focus-visible { outline: 3px solid #1d735b; outline-offset: -3px; }
.place-results .autosuggest-option small { display: block; margin-top: 3px; color: #44685a; font-weight: 400; }
.search-hint { font-size: .82rem; padding: 9px 11px; margin: 0; border-radius: 9px;
    background: #f4f7f3; color: #496258; line-height: 1.45; }

/* ---- Bus animado sobre el recorrido ---- */
.bus-wrapper { background: none; border: 0; }
.bus-marker { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.bus-rot { position: relative; width: 26px; height: 45px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.bus-halo {
    position: absolute; inset: 6px; border-radius: 50%;
    background: var(--bus-color, #176650); opacity: .28;
    animation: bus-pulse 1.8s ease-out infinite;
}
/* @keyframes bus-pulse: una sola definición, en bus3d.css */
.bus-panel {
    background: rgba(255, 255, 255, .96); border-radius: 14px; padding: 8px 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22); min-width: 230px; max-width: 280px; font-size: .82rem;
}
.bus-row { display: flex; align-items: center; gap: 6px; }
.bus-row-meta { margin-top: 6px; justify-content: space-between; color: #184b42; }
.bus-btn {
    min-width: 34px; height: 34px; border: 0; border-radius: 10px; background: #e8f1ee; color: #184b42;
    font-weight: 700; cursor: pointer; padding: 0 8px;
}
.bus-btn:hover, .bus-btn:focus-visible { background: #184b42; color: #fff; }
.bus-play { background: #184b42; color: #fff; }
.bus-range { flex: 1; min-width: 0; accent-color: #184b42; }
.bus-follow { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.bus-panel[hidden] { display: none; }
@media (max-width: 600px) { .bus-panel { min-width: 0; max-width: 200px; } }
@media (prefers-reduced-motion: reduce) { .bus-halo { animation: none; } }

/* Al elegir un punto en el mapa, ningún marcador debe interceptar el clic. */
.picking-location .leaflet-marker-icon,
.picking-location .sevb-marcador,
.picking-location .leaflet-marker-shadow { pointer-events: none !important; }

/* Lista de pasos peatonales: nombre a la izquierda y los dos botones a la derecha. */
.paso-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.paso-row small { color: #5d6b66; overflow-wrap: anywhere; }
.paso-row button { min-height: 36px; padding: 6px 12px; }

/* Avisos flotantes (toast): visibles sobre el mapa aunque el panel inferior esté cerrado. */
#spevbToasts { position: fixed; z-index: 3000; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(92vw, 460px); display: grid; gap: 8px; pointer-events: none; }
.spevb-toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: 14px; background: #1d2a26; color: #fff; font-size: 14px; line-height: 1.35; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); cursor: pointer; }
.spevb-toast.error { background: #9b2c1f; }
.toast-actions { display: flex; gap: 8px; flex: none; }
/* Aviso de ACCIÓN sobre el mapa (elegir un punto moviendo el mapa): contenedor aparte; en celular va abajo a la izquierda (home.css). */
#spevbMapToasts { position: fixed; z-index: 3000; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(92vw, 460px); display: grid; gap: 8px; pointer-events: none; }
.spevb-toast.map-action-toast { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; padding: 10px 12px; border-radius: 16px; background: #124a39; border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); font-size: 15px; line-height: 1.4; cursor: default; }
.spevb-toast.map-action-toast .toast-actions { display: flex; flex-wrap: nowrap; gap: 8px; }
.spevb-toast.map-action-toast button { flex: 1 1 0; min-width: 44px; min-height: 44px; padding: 8px 10px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; }
.spevb-toast.map-action-toast .toast-primary { background: #fff; color: #0f4a38; border: 2px solid #fff; }
.spevb-toast.map-action-toast .toast-secondary { background: transparent; color: #fff; border: 2px solid #fff; }
.spevb-toast.map-action-toast button:focus-visible { outline: 3px solid #ffd54f; outline-offset: 2px; }
.spevb-toast.success { background: #176650; }
.spevb-toast button { flex: none; min-height: 34px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 10px; background: transparent; color: #fff; font-weight: 600; }

/* Pin central para elegir un punto moviendo el mapa (celulares y tabletas). La punta del pin marca el centro exacto. */
.center-pin { position: absolute; z-index: 650; width: 40px; height: 53px; margin: -53px 0 0 -20px; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.center-pin[hidden] { display: none; }

.admin-banner { margin: 10px 24px 0; max-width: 1400px; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.admin-banner.ok { background: #e3f4ea; color: #0f5132; border: 1px solid #b6dfc6; }
.admin-banner.warn { background: #fff6df; color: #5c4a10; border: 1px solid #ecd28a; }
/* editor de paraderos */
.stop-list { display: grid; gap: 6px; margin: 8px 0; max-height: 320px; overflow-y: auto; }
.stop-row { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 6px; align-items: center; }
.stop-row input { min-width: 0; margin: 0; }
.stop-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #1e5fbf; color: #fff; font-weight: 800; font-size: 12px; }
.stop-btn { min-width: 38px; min-height: 38px; padding: 0 8px; margin: 0; }
.stop-pin-wrap { background: none; border: 0; }
.stop-pin { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #1e5fbf; color: #fff; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); font: 800 12px/1 system-ui, sans-serif; }
.adding-stops { cursor: crosshair !important; }
#stopAdd[aria-pressed="true"] { background: #1e5fbf; color: #fff; }
/* al agregar paraderos, los puntos del trazado no capturan los clics (se puede hacer clic en cualquier parte de la línea) */
.adding-stops .vertex-wrapper, .adding-stops .endpoint-wrapper { pointer-events: none !important; }
/* administración de paraderos */
#paradasMap { flex: 1; min-height: 520px; background: #e4eadc; }
.pa-form { border: 0; padding: 0; margin: 8px 0; min-width: 0; display: grid; gap: 6px; }
.pa-modo { margin: 0; padding: 8px 10px; border-radius: 10px; background: #eef3f0; font-size: 13px; font-weight: 700; color: #1f2d27; }
.pa-modo.nuevo { background: #e3f4ea; color: #0f5132; }
.pa-modo.editar { background: #fff6df; color: #5c4a10; }
.pa-rutas { margin: 0; font-size: 13px; color: #1f2d27; }
.pa-rutas b { color: #176650; }
#paAgregar[aria-pressed="true"] { background: #1e5fbf; color: #fff; }
.adding-paradas { cursor: crosshair !important; }
.pa-fila { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 10px; border: 1px solid #dfe6e2; border-radius: 10px; background: #fff; color: #1f2d27; min-height: 44px; }
.pa-fila small { display: block; color: #66736d; font-weight: 400; }
.pa-fila.inactivo { opacity: .55; }

/* ---------- identidad visual (logo, símbolo y mascota) ---------- */
.brand-mark.brand-mark-logo { background: none; padding: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.brand-mark-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.foot-logo { width: 19px; height: 18px; vertical-align: -4px; margin-right: 6px; }
.auth-logo { display: block; justify-self: start; width: 46px; height: auto; margin: 0 0 2px; }
.menu-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid #e3e9e6; }
.menu-brand img { width: 112px; height: auto; opacity: .95; }
.menu-brand-name { font-weight: 800; font-size: 22px; letter-spacing: .14em; color: #176650; padding-left: .14em; }

/* Editor: navegación de vértices (4.10) */
.vertex-nav { display: grid; grid-template-columns: repeat(6, auto); gap: 6px; margin: 6px 0; }
.vertex-nav button { padding: 8px 6px; min-height: 40px; font-size: 0.85rem; }
.vertex-info { font-size: 0.88rem; line-height: 1.45; padding: 8px 10px; border-radius: 8px; background: rgba(23, 102, 80, 0.08); margin-bottom: 6px; }
.vertex-info b { font-variant-numeric: tabular-nums; }
.vertex-sample { pointer-events: none; }
kbd { font: inherit; font-size: 0.8em; padding: 1px 5px; border: 1px solid currentColor; border-radius: 4px; opacity: 0.85; }
@media (max-width: 520px) { .vertex-nav { grid-template-columns: repeat(3, 1fr); } }
.vertex.selected { width: 26px; height: 26px; box-shadow: 0 0 0 5px rgba(239, 182, 76, 0.45), 0 1px 6px #0004; }
.vertex.vecino { width: 11px; height: 11px; border-width: 2px; opacity: 0.9; }

.vertex.anclado { border-color: #6a1b9a; box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.35), 0 1px 5px #0003; }
.edit-box { border: 1px solid rgba(23, 102, 80, 0.35); border-radius: 10px; padding: 10px; margin: 8px 0; background: rgba(23, 102, 80, 0.05); }
.match-summary { display: grid; gap: 2px; font-size: 0.88rem; margin-bottom: 8px; }
.snap-row { display: block; padding: 4px 0; }
