.gm-contenedor {
    max-width: 600px;
    margin: 0 auto;
    font-family: sans-serif;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.gm-seccion { margin-bottom: 25px; }
.gm-seccion h3 { margin-top: 0; font-size: 1.2rem; color: #333; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.gm-plantillas { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; }
.gm-btn-plantilla { background: transparent; border: 2px solid #ddd; border-radius: 8px; padding: 5px; cursor: pointer; transition: all 0.2s ease; width: 80px; height: 80px; }
.gm-btn-plantilla img { width: 100%; height: 100%; object-fit: contain; }
.gm-btn-plantilla:hover, .gm-btn-plantilla.activo { border-color: #0073aa; background: #e5f5fa; }
.gm-label-upload { display: inline-block; background: #0073aa; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.gm-label-upload:hover { background: #005177; }
#gm-nombre-archivo { margin-left: 10px; font-size: 0.9rem; color: #666; }
.gm-canvas-wrapper { width: 100%; max-width: 500px; margin: 0 auto; aspect-ratio: 1 / 1; border: 2px dashed #bbb; background: #fff; position: relative; overflow: hidden; cursor: grab; }
.gm-canvas-wrapper:active { cursor: grabbing; }
#gm-canvas { width: 100%; height: 100%; display: block; }
.gm-instrucciones { font-size: 0.85rem; color: #666; text-align: center; margin-top: 10px; }
.gm-nota-privacidad { font-size: 0.8rem; color: #666; text-align: center; background: #f0f0f0; padding: 10px 12px; border-radius: 6px; margin: 0 0 15px 0; line-height: 1.4; }
.gm-controles-zoom { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.gm-controles-zoom input[type="range"] { flex-grow: 1; }
.gm-btn-descargar { display: block; width: 100%; background: #4caf50; color: #fff; border: none; padding: 15px; font-size: 1.1rem; font-weight: bold; border-radius: 4px; cursor: pointer; transition: background 0.2s; }
.gm-btn-descargar:hover:not(:disabled) { background: #43a047; }
.gm-btn-descargar:disabled { background: #ccc; cursor: not-allowed; }

/* Panel de administración: filas de marcos */
#gm-tabla-marcos .gm-fila-marco td { display: flex; align-items: center; gap: 10px; }
#gm-tabla-marcos .gm-quitar-marco { flex-shrink: 0; }

/* Botón para abrir la cámara */
.gm-opciones-foto { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gm-btn-camara { background: #333; color: #fff; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.gm-btn-camara:hover { background: #111; }

/* Modal de cámara */
.gm-modal-camara {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 15px;
}
.gm-camara-contenido {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 15px;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.gm-camara-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
#gm-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#gm-overlay-marco {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.gm-camara-marcos { justify-content: center; }
.gm-camara-marcos .gm-btn-plantilla { background: rgba(255,255,255,0.1); border-color: #555; }
.gm-camara-marcos .gm-btn-plantilla:hover,
.gm-camara-marcos .gm-btn-plantilla.activo { border-color: #4caf50; background: rgba(76,175,80,0.2); }
.gm-camara-controles { display: flex; flex-wrap: wrap; gap: 10px; }
.gm-camara-controles .button { flex: 1 1 45%; }
.gm-btn-capturar { flex: 1 1 100%; order: 3; background: #4caf50; color: #fff; border: none; padding: 10px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 1rem; }
.gm-btn-capturar:hover { background: #43a047; }
.gm-btn-espejo { background: #e0e0e0; }
.gm-btn-espejo.activo { background: #2271b1; color: #fff; border-color: #2271b1; }
.gm-camara-error { color: #ff6b6b; text-align: center; margin: 0; font-size: 0.9rem; }

@media (min-width: 480px) {
    .gm-camara-controles .button { flex: 1; }
    .gm-btn-capturar { flex: 2; order: initial; }
}
